Skip to content

Commit

Permalink
Hooking up a check-all target for the runtimes projects
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279756 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Chris Bieneman committed Aug 25, 2016
1 parent 59f7ccf commit 774da37
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,9 @@ if( LLVM_INCLUDE_TESTS )
DEPENDS ${LLVM_LIT_DEPENDS}
ARGS ${LLVM_LIT_EXTRA_ARGS}
)
if(TARGET check-runtimes)
add_dependencies(check-all check-runtimes)
endif()
add_custom_target(test-depends DEPENDS ${LLVM_LIT_DEPENDS})
set_target_properties(test-depends PROPERTIES FOLDER "Tests")
endif()
Expand Down
44 changes: 42 additions & 2 deletions runtimes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# Setting these variables will allow the sub-build to put their outputs into
# the library and bin directories of the top-level build.
set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR})
set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_BINARY_DIR})
set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR})

foreach(entry ${runtimes})
get_filename_component(projName ${entry} NAME)
Expand All @@ -52,9 +52,37 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
# will be included under here.
set(HAVE_${canon_name} On)

# Between each sub-project we want to cache and clear the LIT properties
set_property(GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
set_property(GLOBAL PROPERTY LLVM_LIT_PARAMS)
set_property(GLOBAL PROPERTY LLVM_LIT_DEPENDS)
set_property(GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)

add_subdirectory(${projName})

get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS)
get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)

list(APPEND RUNTIMES_LIT_TESTSUITES ${LLVM_LIT_TESTSUITES})
list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS})
list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS})
list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS})
endforeach()

# Add a global check rule now that all subdirectories have been traversed
# and we know the total set of lit testsuites.

add_lit_target(check-runtimes
"Running all regression tests"
${RUNTIMES_LIT_TESTSUITES}
PARAMS ${RUNTIMES_LIT_PARAMS}
DEPENDS ${RUNTIMES_LIT_DEPENDS}
ARGS ${RUNTIMES_LIT_EXTRA_ARGS}
)
add_custom_target(test-depends-runtimes DEPENDS ${RUNTIMES_LIT_DEPENDS})

else() # if this is included from LLVM's CMake
include(LLVMExternalProjectUtils)

Expand Down Expand Up @@ -86,6 +114,14 @@ else() # if this is included from LLVM's CMake
endforeach()

if(runtimes)

foreach(runtime_name ${runtime_names})
list(APPEND extra_targets
${runtime_name}
install-${runtime_name}
check-${runtime_name})
endforeach()

# Create a runtimes target that uses this file as its top-level CMake file.
# The runtimes target is a configuration of all the runtime libraries
# together in a single CMake invocaiton.
Expand All @@ -95,7 +131,11 @@ else() # if this is included from LLVM's CMake
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
PASSTHROUGH_PREFIXES ${prefixes}
EXTRA_TARGETS ${runtime_names}
EXTRA_TARGETS ${extra_targets}
test-depends-runtimes
check-runtimes
USE_TOOLCHAIN)
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS test-depends-runtimes)

endif()
endif()

0 comments on commit 774da37

Please sign in to comment.