FEX/unittests/APITests/CMakeLists.txt
Paulo Matos ad52514b97 Use number of jobs as defined by TEST_JOB_COUNT
At the moment we always run ctest with max number of cpus. If
undefined, it will keep current behaviour, otherwise it will
honour TEST_JOB_COUNT.

Therefore to run ctest one test at a time, use
`cmake ... -DTEST_JOB_COUNT=1`
2024-07-03 14:09:39 +02:00

26 lines
607 B
CMake

set (TESTS
Allocator
InterruptableConditionVariable
Filesystem
)
list(APPEND LIBS FEXCore)
foreach(API_TEST ${TESTS})
add_executable(${API_TEST} ${API_TEST}.cpp)
target_link_libraries(${API_TEST} PRIVATE ${LIBS} Catch2::Catch2WithMain)
catch_discover_tests(${API_TEST}
TEST_SUFFIX ".${API_TEST}.APITest")
endforeach()
add_custom_target(
api_tests
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
USES_TERMINAL
COMMAND "ctest" "--output-on-failure" "--timeout" "302" ${TEST_JOB_FLAG} "-R" "\.*.APITest")
foreach(API_TEST ${TESTS})
add_dependencies(api_tests ${API_TEST})
endforeach()