Skip to content

Commit dffe273

Browse files
TheKayneGamekris-jusiak
authored andcommitted
Added environment variables to test registration
Added environment variables to test registration. So when the test is run using CTest it will actually run the tests using the defined scenario
1 parent f937e1b commit dffe273

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ if (ENABLE_MEMCHECK AND MEMORYCHECK_COMMAND)
7777
string(REPLACE "/" "_" out ${name})
7878
add_executable(${out} ${CMAKE_CURRENT_LIST_DIR}/${name}.cpp)
7979
add_test(${out} ${MEMORYCHECK_COMMAND} --leak-check=full --error-exitcode=1 ./${out})
80+
set_tests_properties(${out}
81+
PROPERTIES
82+
ENVIRONMENT ${scenario}
83+
)
8084
target_link_libraries(${out} gunit)
8185
add_custom_command(TARGET ${out} COMMAND ${scenario} ./${out} --gtest_color=yes USES_TERMINAL)
8286
endfunction()
@@ -85,6 +89,10 @@ else()
8589
string(REPLACE "/" "_" out ${name})
8690
add_executable(${out} ${CMAKE_CURRENT_LIST_DIR}/${name}.cpp)
8791
add_test(${out} ./${out})
92+
set_tests_properties(${out}
93+
PROPERTIES
94+
ENVIRONMENT ${scenario}
95+
)
8896
target_link_libraries(${out} gunit)
8997
add_custom_command(TARGET ${out} COMMAND ${scenario} ./${out} --gtest_color=yes USES_TERMINAL)
9098
endfunction()

0 commit comments

Comments
 (0)