mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 00:38:08 +08:00
Define BOOST_TEST_MODULE in CMake
This removes one #define from each unit test file and ensures consistency between file and module names. This consistency, was not strictly maintained before. I hope that any discrepancies were unintentional and that a 1:1 mapping is actually what is desired. Since the definition is now done at one single place, it would be easy to apply transformations like removing the 'test_' prefix or replacing '_' with '-' if this should be desired.
This commit is contained in:
@@ -248,6 +248,7 @@ foreach(TEST_NAME ${TEST_NAMES})
|
||||
add_executable(${TEST_NAME} ${TEST_NAME}.cpp)
|
||||
target_link_libraries(${TEST_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} toml11::toml11)
|
||||
target_include_directories(${TEST_NAME} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
|
||||
target_compile_definitions(${TEST_NAME} PRIVATE "BOOST_TEST_MODULE=\"${TEST_NAME}\"")
|
||||
|
||||
# to compile tests with <filesystem>...
|
||||
if(TOML11_REQUIRE_FILESYSTEM_LIBRARY)
|
||||
|
Reference in New Issue
Block a user