forked from OpenSCAP/openscap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (36 loc) · 1.48 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function(add_oscap_test TEST_SCRIPT)
string(REPLACE "${CMAKE_SOURCE_DIR}/tests/" "" TEST_NAME "${CMAKE_CURRENT_SOURCE_DIR}/${TEST_SCRIPT}")
add_test(NAME ${TEST_NAME}
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${TEST_SCRIPT}
)
set_tests_properties(${TEST_NAME}
PROPERTIES
SKIP_RETURN_CODE 255
ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR};top_srcdir=${CMAKE_SOURCE_DIR};builddir=${CMAKE_BINARY_DIR}"
)
endfunction()
# builds a binary from a C source that will be used in a test
# EXECUTABLE_NAME - name of the binary executable to be build
# SOURCE_FILE - C program with a test
function(add_oscap_test_executable EXECUTABLE_NAME SOURCE_FILE)
set(TEST_EXECUTABLE_LIBRARIES openscap ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${LIBXSLT_EXSLT_LIBRARIES} ${PCRE_LIBRARIES} ${CURL_LIBRARIES} ${RPM_LIBRARIES})
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILE} ${ARGN})
target_link_libraries(${EXECUTABLE_NAME} ${TEST_EXECUTABLE_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/tests")
endfunction()
configure_file("test_common.sh.in" "test_common.sh" @ONLY)
add_subdirectory("API")
add_subdirectory("bindings")
add_subdirectory("bz2")
add_subdirectory("codestyle")
add_subdirectory("CPE")
add_subdirectory("DS")
add_subdirectory("mitre")
add_subdirectory("nist")
add_subdirectory("offline_mode")
add_subdirectory("oscap_string")
add_subdirectory("oval_details")
add_subdirectory("probes")
add_subdirectory("sce")
add_subdirectory("schemas")
add_subdirectory("sources")