aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/CMakeLists.txt
diff options
context:
space:
mode:
authorSergei Nikulov <sergey.nikulov@gmail.com>2016-06-16 13:53:50 +0300
committerDaniel Stenberg <daniel@haxx.se>2016-06-21 23:04:04 +0200
commit12e21fab26bd83dfa75f009a24380d144ea51857 (patch)
treed1a745c42a4ac1887de5a56928d3bc6f9544dda7 /tests/unit/CMakeLists.txt
parent0bdec5e01d9914d97bb9ed1301b1590162fe2945 (diff)
cmake: now using BUILD_TESTING=ON/OFF
CMake build now using BUILD_TESTING=ON/OFF (default is OFF) to build tests and enabling CTest integration. Options BUILD_CURL_TESTS and BUILD_DASHBOARD_REPORTS was removed. Closes #882 Reviewed-by: Brad King
Diffstat (limited to 'tests/unit/CMakeLists.txt')
-rw-r--r--tests/unit/CMakeLists.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
new file mode 100644
index 000000000..e66679882
--- /dev/null
+++ b/tests/unit/CMakeLists.txt
@@ -0,0 +1,46 @@
+
+set(UT_SRC
+ unit1300.c
+ unit1301.c
+ unit1302.c
+ unit1303.c
+ unit1304.c
+ unit1305.c
+ unit1307.c
+ unit1308.c
+ unit1309.c
+ unit1330.c
+# Broken link on Linux
+# unit1394.c
+ unit1395.c
+ unit1396.c
+ unit1397.c
+ unit1398.c
+ unit1600.c
+ unit1601.c
+ unit1603.c
+# Broken link on Linux
+# unit1604.c
+ )
+
+set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
+include_directories(
+ ${CURL_SOURCE_DIR}/lib # To be able to reach "curl_setup_once.h"
+ ${CURL_SOURCE_DIR}/tests/libtest
+ ${CURL_SOURCE_DIR}/src
+ ${CURL_BINARY_DIR}/lib # To be able to reach "curl_config.h"
+ ${CURL_BINARY_DIR}/include # To be able to reach "curl/curlbuild.h"
+)
+
+foreach(_testfile ${UT_SRC})
+
+ get_filename_component(_testname ${_testfile} NAME_WE)
+ add_executable(${_testname} ${_testfile} ${UT_COMMON_FILES})
+ target_link_libraries(${_testname} libcurl ${CURL_LIBS})
+ set_target_properties(${_testname}
+ PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
+
+ add_test(NAME ${_testname}
+ COMMAND ${_testname} "http://www.google.com"
+ )
+endforeach()