summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..ba5a025
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,53 @@
+find_file(CLANG_TEST_RUNNER TestRunner.sh PATHS ${CMAKE_CURRENT_SOURCE_DIR}
+ DOC "Clang's regression testing script")
+mark_as_advanced(CLANG_TEST_RUNNER)
+
+set(CLANG_TEST_DIRECTORIES
+ "Analysis"
+ "CodeGen"
+ "CodeGenCXX"
+ "CodeGenObjC"
+ "Coverage"
+ "Driver"
+ "FixIt"
+ "Frontend"
+ "Lexer"
+ "Misc"
+ "PCH"
+ "Parser"
+ "Preprocessor"
+ "Rewriter"
+ "Sema"
+ "SemaCXX"
+ "SemaObjC"
+ "SemaObjCXX"
+ "SemaTemplate")
+
+include(FindPythonInterp)
+if(PYTHONINTERP_FOUND)
+ get_target_property(LLVM_TOOLS_PATH clang RUNTIME_OUTPUT_DIRECTORY)
+ set(TESTING_EXTRA_PATHS
+ "${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}:${LLVM_SOURCE_DIR}/test/Scripts")
+ set(all_testdirs)
+ foreach(testdir ${CLANG_TEST_DIRECTORIES})
+ add_custom_target(clang-test-${testdir}
+ ${PYTHON_EXECUTABLE}
+ ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
+ -s
+ "--path=${TESTING_EXTRA_PATHS}"
+ ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Running Clang regression tests in ${testdir}")
+
+ list(APPEND all_testdirs ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/)
+ endforeach()
+
+ add_custom_target(clang-test
+ ${PYTHON_EXECUTABLE}
+ ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
+ "--path=${TESTING_EXTRA_PATHS}"
+ ${all_testdirs}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ DEPENDS clang clang-cc
+ COMMENT "Running Clang regression tests")
+endif()
OpenPOWER on IntegriCloud