OSDN Git Service

Hooking up a check-all target for the runtimes projects
authorChris Bieneman <beanz@apple.com>
Thu, 25 Aug 2016 17:18:41 +0000 (17:18 +0000)
committerChris Bieneman <beanz@apple.com>
Thu, 25 Aug 2016 17:18:41 +0000 (17:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279756 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
runtimes/CMakeLists.txt

index 52a0927..d5d47aa 100644 (file)
@@ -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()
index bbdebff..2d84f47 100644 (file)
@@ -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)
@@ -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)
 
@@ -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.
@@ -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()