mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Changed the main method for tests
This commit is contained in:
@@ -53,6 +53,8 @@ option (COOLPROP_TESTING
|
||||
file(GLOB_RECURSE APP_SOURCES "src/*.cpp")
|
||||
file(GLOB_RECURSE APP_HEADERS "include/*.h" "src/*.h") # "externals/*.hpp")
|
||||
list(REMOVE_ITEM APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Tests/Tests.cpp")
|
||||
## You can exclude this file as well, in case you want to run your own tests
|
||||
#list(REMOVE_ITEM APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Tests/test_main.cpp")
|
||||
|
||||
|
||||
set (APP_INCLUDE_DIRS "externals/eigen")
|
||||
@@ -115,8 +117,6 @@ if (COOLPROP_TESTING)
|
||||
add_executable (testRunner.exe ${APP_SOURCES})
|
||||
add_dependencies (testRunner.exe generate_headers)
|
||||
set_target_properties (testRunner.exe PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DENABLE_CATCH")
|
||||
#set_target_properties (testRunner.exe PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCATCH_CONFIG_MAIN")
|
||||
set_source_files_properties(src/MatrixMath.cpp PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DCATCH_CONFIG_MAIN")
|
||||
if(UNIX)
|
||||
target_link_libraries (testRunner.exe ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
|
||||
5
src/Tests/test_main.cpp
Normal file
5
src/Tests/test_main.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#ifdef ENABLE_CATCH
|
||||
#define CATCH_CONFIG_MAIN
|
||||
#include "catch.hpp"
|
||||
|
||||
#endif /* ENABLE_CATCH */
|
||||
Reference in New Issue
Block a user