forked from OSchip/llvm-project
Hook up lld-test to llvm check-all. Patch by Andy Gibbs!
llvm-svn: 161067
This commit is contained in:
parent
710be7df71
commit
298f38ee68
|
@ -15,41 +15,65 @@ configure_file(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
||||
|
||||
include(FindPythonInterp)
|
||||
if (PYTHONINTERP_FOUND)
|
||||
if (LLVM_MAIN_SRC_DIR)
|
||||
set(LIT "${LLVM_SOURCE_DIR}/utils/lit/lit.py")
|
||||
else()
|
||||
set(LIT "${PATH_TO_LLVM_BUILD}/bin/${CMAKE_CFG_INTDIR}/llvm-lit")
|
||||
# Installed LLVM does not contain ${CMAKE_CFG_INTDIR} in paths.
|
||||
if (NOT EXISTS ${LIT})
|
||||
set(LIT "${PATH_TO_LLVM_BUILD}/bin/llvm-lit")
|
||||
endif()
|
||||
endif()
|
||||
if ( NOT LLD_BUILT_STANDALONE )
|
||||
|
||||
if (PATH_TO_LLVM_BUILD)
|
||||
set(LLD_TEST_EXTRA_ARGS "--path=${LLD_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}")
|
||||
endif()
|
||||
|
||||
set(LIT_ARGS "${LLD_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}")
|
||||
separate_arguments(LIT_ARGS)
|
||||
|
||||
add_custom_target(lld-test.deps)
|
||||
set_target_properties(lld-test.deps PROPERTIES FOLDER "lld tests")
|
||||
|
||||
add_custom_target(lld-test
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${LIT}
|
||||
--param lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
--param build_config=${CMAKE_CFG_INTDIR}
|
||||
--param build_mode=${RUNTIME_BUILD_MODE}
|
||||
${LIT_ARGS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Running lld regression tests")
|
||||
set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
|
||||
|
||||
add_dependencies(lld-test lld-test.deps)
|
||||
add_dependencies(lld-test.deps
|
||||
lld-core
|
||||
set(LLD_TEST_DEPS
|
||||
lld-core lld-test.deps
|
||||
FileCheck not llvm-nm
|
||||
)
|
||||
set(LLD_TEST_PARAMS
|
||||
lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
)
|
||||
|
||||
add_lit_testsuite(check-lld "Running lld regression tests"
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
PARAMS ${LLD_TEST_PARAMS}
|
||||
DEPENDS ${LLD_TEST_DEPS}
|
||||
)
|
||||
|
||||
set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
|
||||
|
||||
else()
|
||||
|
||||
include(FindPythonInterp)
|
||||
if (PYTHONINTERP_FOUND)
|
||||
if (LLVM_MAIN_SRC_DIR)
|
||||
set(LIT "${LLVM_SOURCE_DIR}/utils/lit/lit.py")
|
||||
else()
|
||||
set(LIT "${PATH_TO_LLVM_BUILD}/bin/${CMAKE_CFG_INTDIR}/llvm-lit")
|
||||
# Installed LLVM does not contain ${CMAKE_CFG_INTDIR} in paths.
|
||||
if (NOT EXISTS ${LIT})
|
||||
set(LIT "${PATH_TO_LLVM_BUILD}/bin/llvm-lit")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (PATH_TO_LLVM_BUILD)
|
||||
set(LLD_TEST_EXTRA_ARGS "--path=${LLD_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}")
|
||||
endif()
|
||||
|
||||
set(LIT_ARGS "${LLD_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}")
|
||||
separate_arguments(LIT_ARGS)
|
||||
|
||||
add_custom_target(lld-test.deps)
|
||||
set_target_properties(lld-test.deps PROPERTIES FOLDER "lld tests")
|
||||
|
||||
add_custom_target(check-lld
|
||||
COMMAND ${PYTHON_EXECUTABLE}
|
||||
${LIT}
|
||||
--param lld_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
||||
--param build_config=${CMAKE_CFG_INTDIR}
|
||||
--param build_mode=${RUNTIME_BUILD_MODE}
|
||||
${LIT_ARGS}
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Running lld regression tests"
|
||||
DEPENDS lld-core lld-test.deps
|
||||
)
|
||||
set_target_properties(check-lld PROPERTIES FOLDER "lld tests")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# Add a legacy target spelling: lld-test
|
||||
add_custom_target(lld-test)
|
||||
add_dependencies(lld-test check-lld)
|
||||
set_target_properties(lld-test PROPERTIES FOLDER "lld tests")
|
||||
|
|
Loading…
Reference in New Issue