summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-11 13:56:31 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-06-05 07:14:25 +0100
commit43f87fb93a782851f9cd5ce0ca9a0a2608994ccd (patch)
treede3d604bc37976d5273da7c6d5ed7b12be6adc91
parentffc944cd60c4f7fa3e05934448355dc46bfa5d6c (diff)
downloadlibgit2-43f87fb93a782851f9cd5ce0ca9a0a2608994ccd.tar.gz
refactor source tree: factor common clar function
Put the common clar test function into the tests/CMakeLists.txt for reusability.
-rw-r--r--tests/CMakeLists.txt8
-rw-r--r--tests/libgit2/CMakeLists.txt8
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 1b31354e5..3bff439f9 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1 +1,9 @@
+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}/libgit2_tests" ${ARGN})
+ else()
+ add_test(${name} "${libgit2_BINARY_DIR}/libgit2_tests" ${ARGN})
+ endif()
+endfunction(add_clar_test)
+
add_subdirectory(libgit2)
diff --git a/tests/libgit2/CMakeLists.txt b/tests/libgit2/CMakeLists.txt
index 7efcc1c1f..3e8dd12e3 100644
--- a/tests/libgit2/CMakeLists.txt
+++ b/tests/libgit2/CMakeLists.txt
@@ -60,14 +60,6 @@ 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}/libgit2_tests" ${ARGN})
- else()
- add_test(${name} "${libgit2_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)