From: Daniel Dunbar Date: Sun, 8 Nov 2009 09:08:00 +0000 (+0000) Subject: Derive the right paths to use during testing instead of passing it in via make. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5ed7be1a401d7f75e08623b0172f0318f2977e31;p=oota-llvm.git Derive the right paths to use during testing instead of passing it in via make. Also, fix a few other details of the cmake test target and rename it to 'check'. CMake tests now work for the most part, but there are a handful of failures left due to missing site.exp bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86452 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 681e50d0a87..36572852dc3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -5,31 +5,31 @@ set(TARGETS_TO_BUILD ${TARGETS_BUILT}) include(FindPythonInterp) if(PYTHONINTERP_FOUND) - get_target_property(LLVM_TOOLS_PATH llvm-config RUNTIME_OUTPUT_DIRECTORY) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in ${CMAKE_CURRENT_BINARY_DIR}/site.exp) - add_custom_target(llvm-test + MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit) + + add_custom_target(check COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#" -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#" - -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#" - -e "s#\@LLVMGCC_DIR\@##" + -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}#" + -e "s#\@LLVMGCCDIR\@##" ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in > ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#" -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#" - -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#" - -e "s#\@LLVMGCC_DIR\@##" + -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}#" + -e "s#\@LLVMGCCDIR\@##" -e "s#\@LLVM_BUILD_MODE\@#${CMAKE_CFG_INTDIR}#" ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in > ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg - COMMAND ${PYTHON_EXECUTABLE} + COMMAND ${PYTHON_EXECUTABLE} ${LLVM_SOURCE_DIR}/utils/lit/lit.py -sv ${CMAKE_CURRENT_BINARY_DIR} DEPENDS COMMENT "Running LLVM regression tests") -endif() +endif() diff --git a/test/Makefile b/test/Makefile index e3e66d53ef4..2eba9159049 100644 --- a/test/Makefile +++ b/test/Makefile @@ -98,19 +98,11 @@ endif check-local-lit:: lit.site.cfg Unit/lit.site.cfg ( $(ULIMIT) \ - $(LLVM_SRC_ROOT)/utils/lit/lit.py \ - --path "$(LLVMToolDir)" \ - --path "$(LLVM_SRC_ROOT)/test/Scripts" \ - --path "$(LLVMGCCDIR)/bin" \ - $(LIT_ARGS) $(LIT_TESTSUITE) ) + $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_TESTSUITE) ) check-local-all:: lit.site.cfg Unit/lit.site.cfg extra-lit-site-cfgs ( $(ULIMIT) \ - $(LLVM_SRC_ROOT)/utils/lit/lit.py \ - --path "$(LLVMToolDir)" \ - --path "$(LLVM_SRC_ROOT)/test/Scripts" \ - --path "$(LLVMGCCDIR)/bin" \ - $(LIT_ARGS) $(LIT_ALL_TESTSUITES) ) + $(LLVM_SRC_ROOT)/utils/lit/lit.py $(LIT_ARGS) $(LIT_ALL_TESTSUITES) ) ifdef TESTONE CLEANED_TESTONE := $(patsubst %/,%,$(TESTONE)) diff --git a/test/lit.cfg b/test/lit.cfg index 1965615ae81..19397923277 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -22,6 +22,31 @@ llvm_obj_root = getattr(config, 'llvm_obj_root', None) if llvm_obj_root is not None: config.test_exec_root = os.path.join(llvm_obj_root, 'test') +# Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin +# dir (if available). +if llvm_obj_root is not None: + llvm_src_root = getattr(config, 'llvm_src_root', None) + if not llvm_src_root: + lit.fatal('No LLVM source root set!') + path = os.path.pathsep.join((os.path.join(llvm_src_root, 'test', + 'Scripts'), + config.environment['PATH'])) + config.environment['PATH'] = path + + llvm_tools_dir = getattr(config, 'llvm_tools_dir', None) + if not llvm_tools_dir: + lit.fatal('No LLVM tools dir set!') + path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH'])) + config.environment['PATH'] = path + + llvmgcc_dir = getattr(config, 'llvmgcc_dir', None) + if not llvm_tools_dir: + lit.fatal('No llvm-gcc dir set!') + if llvmgcc_dir: + path = os.path.pathsep.join((os.path.join(llvmgcc_dir, 'bin'), + config.environment['PATH'])) + config.environment['PATH'] = path + ### import os