aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-06-09 08:09:49 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-06-09 08:09:49 -0400
commit3357f87a5efe478be2433787c29de640dc21b33d (patch)
tree262c5694ce650506afb348e7cdc521c7cb9cc629 /tests/CMakeLists.txt
parent11aa1d44d95da221073e512fbec3bbccc0f1a46b (diff)
downloadstasis-3357f87a5efe478be2433787c29de640dc21b33d.tar.gz
Initial commit of unit tests [WIP]
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644
index 0000000..dd349e2
--- /dev/null
+++ b/tests/CMakeLists.txt
@@ -0,0 +1,28 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_BINARY_DIR}/include
+)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/tests)
+set(CTEST_BINARY_DIRECTORY ${PROJECT_BINARY_DIR}/tests)
+
+file(GLOB files "test_*.c")
+
+foreach(file ${files})
+ string(REGEX REPLACE "(^.*/|\\.[^.]*$)" "" file_without_ext ${file})
+ add_executable(${file_without_ext} ${file})
+ if(NOT(MSVC))
+ target_compile_options(${file_without_ext} PRIVATE
+ -Wno-unused-parameter
+ -Wno-unused-but-set-variable
+ -Wno-incompatible-pointer-types-discards-qualifiers
+ -Wno-discarded-qualifiers)
+ endif()
+ target_link_libraries(${file_without_ext} PRIVATE ohmycal)
+ add_test(${file_without_ext} ${file_without_ext})
+ set_tests_properties(${file_without_ext}
+ PROPERTIES
+ TIMEOUT 120)
+ set_tests_properties(${file_without_ext}
+ PROPERTIES
+ SKIP_RETURN_CODE 127)
+endforeach() \ No newline at end of file