Home | History | Annotate | Download | only in unit
      1 
      2 set(UT_SRC
      3   unit1300.c
      4   unit1301.c
      5   unit1302.c
      6   unit1303.c
      7   unit1304.c
      8   unit1305.c
      9   unit1307.c
     10   unit1308.c
     11   unit1309.c
     12   unit1330.c
     13 # Broken link on Linux
     14 #  unit1394.c
     15   unit1395.c
     16   unit1396.c
     17   unit1397.c
     18   unit1398.c
     19   unit1600.c
     20   unit1601.c
     21   unit1603.c
     22 # Broken link on Linux
     23 #  unit1604.c
     24   )
     25 
     26 set(UT_COMMON_FILES ../libtest/first.c ../libtest/test.h curlcheck.h)
     27 include_directories(
     28   ${CURL_SOURCE_DIR}/lib          # To be able to reach "curl_setup_once.h"
     29   ${CURL_SOURCE_DIR}/tests/libtest
     30   ${CURL_SOURCE_DIR}/src
     31   ${CURL_BINARY_DIR}/lib          # To be able to reach "curl_config.h"
     32   ${CURL_BINARY_DIR}/include      # To be able to reach "curl/curl.h"
     33 )
     34 
     35 foreach(_testfile ${UT_SRC})
     36 
     37   get_filename_component(_testname ${_testfile} NAME_WE)
     38   add_executable(${_testname} ${_testfile} ${UT_COMMON_FILES})
     39   target_link_libraries(${_testname} libcurl ${CURL_LIBS})
     40   set_target_properties(${_testname}
     41       PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
     42 
     43   if(HIDES_CURL_PRIVATE_SYMBOLS)
     44     set_target_properties(${_testname}
     45 	  PROPERTIES
     46 		EXCLUDE_FROM_ALL TRUE
     47 		EXCLUDE_FROM_DEFAULT_BUILD TRUE
     48 	)
     49   else()
     50     add_test(NAME ${_testname}
     51              COMMAND ${_testname} "http://www.google.com"
     52     )
     53   endif()
     54 endforeach()
     55