aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 19:14:27 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-06-28 19:14:27 +0200
commit605c94d57fbc2e776843fadc7443a2f713cf631d (patch)
treea16595e4d16de1d9dbeb92aa7b75a1798da72317 /test/CMakeLists.txt
parenttest: add test for actual CI runs (diff)
downloadcimple-605c94d57fbc2e776843fadc7443a2f713cf631d.tar.gz
cimple-605c94d57fbc2e776843fadc7443a2f713cf631d.zip
test: add test timeouts, prettier output
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 6195eec..326a50b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,17 +1,24 @@
find_package(Python3 REQUIRED COMPONENTS Interpreter)
-set(args
+set(python_test_args
+ --no-header -v
"${CMAKE_CURRENT_SOURCE_DIR}"
--server-binary "$<TARGET_FILE:server>"
--worker-binary "$<TARGET_FILE:worker>"
--client-binary "$<TARGET_FILE:client>"
--project-version "${PROJECT_VERSION}")
-add_test(NAME python_tests
- COMMAND Python3::Interpreter -m pytest ${args}
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+function(add_my_test name)
+ list(POP_FRONT ARGV)
+ add_test(NAME "${name}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMAND ${ARGV})
+ set_tests_properties("${name}" PROPERTIES TIMEOUT 60)
+endfunction()
-add_test(NAME python_tests_valgrind
- COMMAND Python3::Interpreter -m pytest ${args}
- --valgrind-binary "${CMAKE_CURRENT_SOURCE_DIR}/../src/valgrind.sh"
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+add_my_test(python_tests
+ Python3::Interpreter -m pytest ${python_test_args})
+
+add_my_test(python_tests_valgrind
+ Python3::Interpreter -m pytest ${python_test_args}
+ --valgrind-binary "${CMAKE_CURRENT_SOURCE_DIR}/../src/valgrind.sh")