set(CLANG_TOOLS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
set(CLANG_TOOLS_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
- )
-
option(CLANG_TOOLS_TEST_USE_VG "Run Clang tools' tests under Valgrind" OFF)
if(CLANG_TOOLS_TEST_USE_VG)
set(CLANG_TOOLS_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
endif()
+add_subdirectory(cpp11-migrate)
+
+set(TEST_SOURCE_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
+set(TEST_EXEC_ROOT ${CMAKE_CURRENT_BINARY_DIR})
+set(TESTSUITE_NAME "Clang Tools")
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ )
+
set(CLANG_TOOLS_TEST_DEPS
# Base line deps.
clang clang-headers FileCheck count not
+ # cpp11-migrate auto-generated tests. See cpp11-migrate/CMakeLists.txt.
+ cpp11-migrate-autogen
+
# Individual tools we test.
remove-cstr-calls cpp11-migrate clang-format
)
add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/cpp11-migrate/autogen
DEPENDS ${CLANG_TOOLS_TEST_DEPS}
ARGS ${CLANG_TOOLS_TEST_EXTRA_ARGS}
)
set_target_properties(check-clang-tools PROPERTIES FOLDER "Clang extra tools' tests")
-
##===----------------------------------------------------------------------===##
CLANG_LEVEL := ../../..
+include $(CLANG_LEVEL)/../../Makefile.config
+
+# Recurse into any subdirectories that have their own Makefiles.
+DIRS := cpp11-migrate
include $(CLANG_LEVEL)/Makefile
# Test in all immediate subdirectories if unset.
# Allow EXTRA_TESTDIRS to provide additional test directories.
TESTDIRS += $(EXTRA_TESTDIRS)
+# List of roots for auto-generated tests.
+TESTDIRS += $(PROJ_OBJ_DIR)/cpp11-migrate/autogen
+
ifndef TESTARGS
ifdef VERBOSE
TESTARGS = -v
@$(ECHOPATH) s=@CLANG_TOOLS_SOURCE_DIR@=$(PROJ_SRC_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@CLANG_TOOLS_BINARY_DIR@=$(PROJ_OBJ_DIR)/..=g >> lit.tmp
@$(ECHOPATH) s=@TARGET_TRIPLE@=$(TARGET_TRIPLE)=g >> lit.tmp
+ @$(ECHOPATH) s=@TEST_SOURCE_ROOT@=$(PROJ_SRC_DIR)=g >> lit.tmp
+ @$(ECHOPATH) s=@TEST_EXEC_ROOT@=$(PROJ_OBJ_DIR)=g >> lit.tmp
+ @$(ECHOPATH) s=@TESTSUITE_NAME@=Clang Tools=g >> lit.tmp
@sed -f lit.tmp $(PROJ_SRC_DIR)/lit.site.cfg.in > $@
@-rm -f lit.tmp
# Configuration file for the 'lit' test runner.
-# name: The name of this test suite.
-config.name = 'Clang Tools'
-
-# Tweak PATH for Win32
+# weak PATH for Win32
if platform.system() == 'Windows':
- # Seek sane tools in directories and set to $PATH.
+ # Seek sane tools in directories and set to $PATH.
path = getattr(config, 'lit_tools_dir', None)
path = lit.getToolsPath(path,
config.environment['PATH'],
# suffixes: A list of file extensions to treat as test files.
config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s']
-# test_source_root: The root path where tests are located.
-config.test_source_root = os.path.dirname(__file__)
-
-# test_exec_root: The root path where tests should be run.
-clang_tools_binary_dir = getattr(config, 'clang_tools_binary_dir', None)
-if clang_tools_binary_dir is not None:
- config.test_exec_root = os.path.join(clang_tools_binary_dir, 'test')
-
# Clear some environment variables that might affect Clang.
#
# This first set of vars are read by Clang, but shouldn't affect tests
del config.environment[name]
# Tweak the PATH to include the tools dir and the scripts dir.
-if clang_tools_binary_dir is not None:
+if hasattr(config, 'clang_tools_binary_dir'):
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if not llvm_tools_dir:
lit.fatal('No LLVM tools dir set!')
config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
+config.name = "@TESTSUITE_NAME@"
+config.test_source_root = "@TEST_SOURCE_ROOT@"
+config.test_exec_root = "@TEST_EXEC_ROOT@"
+
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
try: