From ad6416986755e417c66e2c646d532561b445a5b5 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 10 May 2020 02:12:12 +0200 Subject: CMake: fix runtests.pl with CMake, add new test targets * runtests.pl: - Fix out-of-tree build under CMake when srcdir is not set. Default srcdir to the location of runtests.pl. - Add a hack to allow CMake to use the TFLAGS option as documented in tests/README and used in scripts/travis/script.sh. * Bump CMake version to 3.2 for USES_TERMINAL, dropping Debian Jessie support (no one should care, it is already EOL.). * Remove CTest since it defines its own 'test' target with no tests since all unittests are already broken and not built by default. * Add new test targets based on the options from Makefile.am. Since new test targets are rarely added, I opted for duplicating the runtests.pl options as opposed to creating a new Makefile.inc file. Use top-level target names (test-x) instead of x-test since that is used by CI and others. Closes #5358 --- tests/unit/CMakeLists.txt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tests/unit/CMakeLists.txt') diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index a18ea18e0..e5c4127a0 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -20,6 +20,9 @@ # ########################################################################### +# TODO build a special libcurlu library for unittests. +return() + set(UT_SRC unit1300.c unit1301.c @@ -63,16 +66,4 @@ foreach(_testfile ${UT_SRC}) target_link_libraries(${_testname} libcurl ${CURL_LIBS}) set_target_properties(${_testname} PROPERTIES COMPILE_DEFINITIONS "UNITTESTS") - - if(HIDES_CURL_PRIVATE_SYMBOLS) - set_target_properties(${_testname} - PROPERTIES - EXCLUDE_FROM_ALL TRUE - EXCLUDE_FROM_DEFAULT_BUILD TRUE - ) - else() - add_test(NAME ${_testname} - COMMAND ${_testname} "http://www.google.com" - ) - endif() endforeach() -- cgit v1.2.3