summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-11-17 14:31:29 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-02-22 22:07:45 -0500
commitd02f4f7ad73d91504b9c9eb096989684edbc3417 (patch)
tree30dc04f8533c8cc1379bdeaae622e46e5920cf6c /tests
parente6d93612e86f50809b941030ef605382895e6f0a (diff)
downloadlibgit2-d02f4f7ad73d91504b9c9eb096989684edbc3417.tar.gz
cmake: refactor `add_clar_test` into separate module
Diffstat (limited to 'tests')
-rw-r--r--tests/libgit2/CMakeLists.txt27
-rw-r--r--tests/util/CMakeLists.txt11
2 files changed, 12 insertions, 26 deletions
diff --git a/tests/libgit2/CMakeLists.txt b/tests/libgit2/CMakeLists.txt
index 90ae6253e..27f421ad6 100644
--- a/tests/libgit2/CMakeLists.txt
+++ b/tests/libgit2/CMakeLists.txt
@@ -63,20 +63,13 @@ if(MSVC_IDE)
set_source_files_properties("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h")
endif()
-function(ADD_CLAR_TEST name)
- if(NOT USE_LEAK_CHECKER STREQUAL "OFF")
- add_test(${name} "${PROJECT_SOURCE_DIR}/script/${USE_LEAK_CHECKER}.sh" "${PROJECT_BINARY_DIR}/libgit2_tests" ${ARGN})
- else()
- add_test(${name} "${PROJECT_BINARY_DIR}/libgit2_tests" ${ARGN})
- endif()
-endfunction(ADD_CLAR_TEST)
-
-add_clar_test(offline -v -xonline)
-add_clar_test(invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
-add_clar_test(online -v -sonline -xonline::customcert)
-add_clar_test(online_customcert -v -sonline::customcert)
-add_clar_test(gitdaemon -v -sonline::push)
-add_clar_test(ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
-add_clar_test(proxy -v -sonline::clone::proxy)
-add_clar_test(auth_clone -v -sonline::clone::cred)
-add_clar_test(auth_clone_and_push -v -sonline::clone::push -sonline::push)
+include(AddClarTest)
+add_clar_test(libgit2_tests offline -v -xonline)
+add_clar_test(libgit2_tests invasive -v -score::ftruncate -sfilter::stream::bigfile -sodb::largefiles -siterator::workdir::filesystem_gunk -srepo::init -srepo::init::at_filesystem_root)
+add_clar_test(libgit2_tests online -v -sonline -xonline::customcert)
+add_clar_test(libgit2_tests online_customcert -v -sonline::customcert)
+add_clar_test(libgit2_tests gitdaemon -v -sonline::push)
+add_clar_test(libgit2_tests ssh -v -sonline::push -sonline::clone::ssh_cert -sonline::clone::ssh_with_paths -sonline::clone::path_whitespace_ssh)
+add_clar_test(libgit2_tests proxy -v -sonline::clone::proxy)
+add_clar_test(libgit2_tests auth_clone -v -sonline::clone::cred)
+add_clar_test(libgit2_tests auth_clone_and_push -v -sonline::clone::push -sonline::push)
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 739eb5859..232590ffd 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -62,14 +62,7 @@ if(MSVC_IDE)
set_source_files_properties("precompiled.c" COMPILE_FLAGS "/Ycprecompiled.h")
endif()
-function(ADD_CLAR_TEST name)
- if(NOT USE_LEAK_CHECKER STREQUAL "OFF")
- add_test(${name} "${libgit2_SOURCE_DIR}/script/${USE_LEAK_CHECKER}.sh" "${libgit2_BINARY_DIR}/util_tests" ${ARGN})
- else()
- add_test(${name} "${libgit2_BINARY_DIR}/util_tests" ${ARGN})
- endif()
-endfunction(ADD_CLAR_TEST)
-
enable_testing()
-add_clar_test(util -v)
+include(AddClarTest)
+add_clar_test(util_tests util -v)