Lines Matching +full:- +full:c
8 # We use the check unit testing framework for our C unit tests
13 # ${CIVETWEB_THIRD_PARTY_DIR}/src/check-unit-test-framework/CMakeLists.txt
19 ExternalProject_Add(check-unit-test-framework
20 DEPENDS civetweb-c-library
36 "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
37 "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}"
38 "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
46 ExternalProject_Get_Property(check-unit-test-framework INSTALL_DIR)
69 # Build the C unit tests
70 add_library(shared-c-unit-tests STATIC shared.c)
72 shared-c-unit-tests PUBLIC
75 add_library(public-func-c-unit-tests STATIC public_func.c)
77 target_compile_definitions(public-func-c-unit-tests PRIVATE CIVETWEB_DLL_IMPORTS)
80 public-func-c-unit-tests PUBLIC
82 target_link_libraries(public-func-c-unit-tests civetweb-c-library ${CHECK_LIBRARIES})
83 add_dependencies(public-func-c-unit-tests check-unit-test-framework)
85 add_library(public-server-c-unit-tests STATIC public_server.c)
87 target_compile_definitions(public-server-c-unit-tests PRIVATE CIVETWEB_DLL_IMPORTS)
90 public-server-c-unit-tests PUBLIC
92 target_link_libraries(public-server-c-unit-tests civetweb-c-library ${CHECK_LIBRARIES})
93 add_dependencies(public-server-c-unit-tests check-unit-test-framework)
95 add_library(private-c-unit-tests STATIC private.c)
97 private-c-unit-tests PUBLIC
99 target_link_libraries(private-c-unit-tests ${CHECK_LIBRARIES})
100 add_dependencies(private-c-unit-tests check-unit-test-framework)
102 add_library(timer-c-unit-tests STATIC timertest.c)
104 timer-c-unit-tests PUBLIC
106 target_link_libraries(timer-c-unit-tests ${CHECK_LIBRARIES})
107 add_dependencies(timer-c-unit-tests check-unit-test-framework)
109 add_library(exe-c-unit-tests STATIC private_exe.c)
111 target_compile_definitions(exe-c-unit-tests PRIVATE)
114 exe-c-unit-tests PUBLIC
116 target_link_libraries(exe-c-unit-tests civetweb-c-library ${CHECK_LIBRARIES})
117 add_dependencies(exe-c-unit-tests check-unit-test-framework)
119 add_executable(main-c-unit-test main.c)
120 target_link_libraries(main-c-unit-test
121 shared-c-unit-tests
122 public-func-c-unit-tests
123 public-server-c-unit-tests
124 private-c-unit-tests
125 timer-c-unit-tests
126 exe-c-unit-tests
128 add_dependencies(main-c-unit-test check-unit-test-framework)
133 DEPENDS main-c-unit-test)
137 set(test "test-${suite}-${test_case}")
139 string(REGEX REPLACE "[^-A-Za-z0-9]" "-" test "${test}")
142 …COMMAND main-c-unit-test "--test-dir=${CMAKE_CURRENT_SOURCE_DIR}" "--suite=${suite}" "--test-case=…
146 ENVIRONMENT "PATH=${test_path}\\;$<TARGET_FILE_DIR:civetweb-c-library>")
207 # Tests with main.c
220 COMMAND ${LCOV_EXECUTABLE} -q -z -d .
221 COMMAND ${LCOV_EXECUTABLE} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o before.lcov -i
222 COMMAND ${CTEST_EXECUTABLE} --force-new-ctest-process
223 COMMAND ${LCOV_EXECUTABLE} -q --no-external -c -b "${CMAKE_SOURCE_DIR}" -d . -o after.lcov
224 COMMAND ${LCOV_EXECUTABLE} -q -a before.lcov -a after.lcov --output-file final.lcov
225 COMMAND ${LCOV_EXECUTABLE} -q -r final.lcov "'${CMAKE_SOURCE_DIR}/unittest/*'" -o final.lcov
226 …COMMAND ${GENHTML_EXECUTABLE} final.lcov -o lcov --demangle-cpp --sort -p "${CMAKE_SOURCE_DIR}" -t…
227 DEPENDS main-c-unit-test
248 " --coverage flag: ${C_FLAG_COVERAGE_MESSAGE}")