summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt')
-rw-r--r--compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt b/compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt
new file mode 100644
index 00000000000..7b800fe1ae3
--- /dev/null
+++ b/compiler-rt/lib/dfsan/lit_tests/CMakeLists.txt
@@ -0,0 +1,23 @@
+set(DFSAN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
+set(DFSAN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
+
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ )
+
+if(COMPILER_RT_CAN_EXECUTE_TESTS)
+ # Run DFSan tests only if we're sure we may produce working binaries.
+ set(DFSAN_TEST_DEPS
+ ${SANITIZER_COMMON_LIT_TEST_DEPS}
+ ${DFSAN_RUNTIME_LIBRARIES})
+ set(DFSAN_TEST_PARAMS
+ dfsan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ )
+ add_lit_testsuite(check-dfsan "Running the DataFlowSanitizer tests"
+ ${CMAKE_CURRENT_BINARY_DIR}
+ PARAMS ${DFSAN_TEST_PARAMS}
+ DEPENDS ${DFSAN_TEST_DEPS}
+ )
+ set_target_properties(check-dfsan PROPERTIES FOLDER "DFSan tests")
+endif()
OpenPOWER on IntegriCloud