Skip to content

Commit

Permalink
Mongoose: Make tests compatible with multi-config generators (like MSVC)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Nov 5, 2023
1 parent 406c8d8 commit c9339fa
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Mongoose/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ if ( Python_Interpreter_FOUND )
add_test ( NAME Mongoose_IO_Test
COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t io -k )

if (WIN32)
if ( WIN32 )
set_tests_properties ( Mongoose_IO_Test PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PROJECT_BINARY_DIR}" )
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:Mongoose>" )
endif ( )

# Edge Separator Tests
Expand All @@ -333,9 +333,9 @@ if ( Python_Interpreter_FOUND )
add_test ( NAME Mongoose_Target_Split_Test
COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t edgesep -s 0.3 )

if (WIN32)
if ( WIN32 )
set_tests_properties ( Mongoose_Edge_Separator_Test Mongoose_Edge_Separator_Test_2 Mongoose_Weighted_Edge_Separator_Test Mongoose_Target_Split_Test PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PROJECT_BINARY_DIR}" )
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:Mongoose>" )
endif ( )

# Memory Tests
Expand All @@ -349,9 +349,9 @@ if ( Python_Interpreter_FOUND )
add_test ( NAME Mongoose_Memory_Test
COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -min 1 -max 15 -t memory )

if (WIN32)
if ( WIN32 )
set_tests_properties ( Mongoose_Memory_Test PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PROJECT_BINARY_DIR}" )
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:Mongoose>" )
endif ( )

# Performance Test
Expand All @@ -376,9 +376,9 @@ if ( Python_Interpreter_FOUND )
add_test ( NAME Mongoose_Performance_Test_2
COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Tests/runTests -t performance -i 21 39 1557 1562 353 2468 1470 1380 505 182 201 2331 760 1389 2401 2420 242 250 1530 1533 -p )

if (WIN32)
if ( WIN32 )
set_tests_properties ( Mongoose_Performance_Test Mongoose_Performance_Test_2 PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PROJECT_BINARY_DIR}" )
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:Mongoose>" )
endif ( )
endif ( )

Expand All @@ -404,7 +404,8 @@ add_executable ( mongoose_unit_test_io
target_link_libraries ( mongoose_unit_test_io Mongoose_static_dbg )
set_target_properties ( mongoose_unit_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH} )
add_test ( NAME Mongoose_Unit_Test_IO
COMMAND ${TESTING_OUTPUT_PATH}/mongoose_unit_test_io )
COMMAND ${TESTING_OUTPUT_PATH}/mongoose_unit_test_io
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/Tests )

add_executable ( mongoose_unit_test_graph
Tests/Mongoose_UnitTest_Graph_exe.cpp )
Expand All @@ -424,7 +425,7 @@ add_test ( NAME Mongoose_Unit_Test_EdgeSep

if (WIN32)
set_tests_properties ( Mongoose_Unit_Test_IO Mongoose_Unit_Test_Graph Mongoose_Unit_Test_EdgeSep PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PROJECT_BINARY_DIR}" )
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:Mongoose>" )
endif ( )

if ( $ENV{MONGOOSE_COVERAGE} )
Expand Down

0 comments on commit c9339fa

Please sign in to comment.