diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2021-05-05 19:57:39 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2021-05-05 19:57:39 -0400 |
commit | a92b4038179c3706bd176097be1caabd88824755 (patch) | |
tree | 3ca109b34e24e5940e2d12acca39091c83963fd3 /tests/CMakeLists.txt | |
parent | ea6e2613aca23c84373e686d739498969062f79e (diff) | |
download | cleanpath-a92b4038179c3706bd176097be1caabd88824755.tar.gz |
Add tests
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r-- | tests/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..4f23ecf --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,22 @@ +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) +set(PROJECT_LIBS cleanpath_static) + +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) + endif() + target_link_libraries(${file_without_ext} ${PROJECT_LIBS}) + add_test(${file_without_ext} ${file_without_ext}) + set_tests_properties(${file_without_ext} + PROPERTIES + TIMEOUT 120) +endforeach() |