From a9d4c796a8f9a75dd096b36069441d55254e920a Mon Sep 17 00:00:00 2001 From: David Andrs Date: Tue, 9 Jul 2024 13:08:21 -0600 Subject: [PATCH] Removing config.h.in from tests --- CMakeLists.txt | 3 +++ test/CMakeLists.txt | 8 ++++---- test/File_test.cpp | 1 - test/config.h.in | 3 --- 4 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 test/config.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 1149a71..a9513ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,9 @@ endif() # Tests if (EXODUSIICPP_BUILD_TESTS) + set(EXODUSIICPP_UNIT_TEST_ASSETS ${CMAKE_SOURCE_DIR}/test/assets CACHE PATH "" FORCE) + mark_as_advanced(FORCE EXODUSIICPP_UNIT_TEST_ASSETS) + enable_testing() add_subdirectory(test) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b151bae..33e37ff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,10 +31,10 @@ target_link_libraries( gmock_main ) -set(EXODUSIICPP_UNIT_TEST_ASSETS ${PROJECT_SOURCE_DIR}/assets CACHE PATH "" FORCE) -mark_as_advanced(FORCE EXODUSIICPP_UNIT_TEST_ASSETS) - -configure_file(config.h.in config.h) +target_compile_definitions(${PROJECT_NAME} + PRIVATE + -DEXODUSIICPP_UNIT_TEST_ASSETS="${EXODUSIICPP_UNIT_TEST_ASSETS}" +) add_test( NAME ${PROJECT_NAME} diff --git a/test/File_test.cpp b/test/File_test.cpp index b5eac13..b1095f2 100644 --- a/test/File_test.cpp +++ b/test/File_test.cpp @@ -1,6 +1,5 @@ #include "gmock/gmock.h" #include "exodusIIcpp/exodusIIcpp.h" -#include "config.h" using namespace exodusIIcpp; using namespace testing; diff --git a/test/config.h.in b/test/config.h.in deleted file mode 100644 index c7a243f..0000000 --- a/test/config.h.in +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -#define EXODUSIICPP_UNIT_TEST_ASSETS "@EXODUSIICPP_UNIT_TEST_ASSETS@"