[test-suite] r266777 - Add 'check' target that runs lit after building the tests

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 10:49:04 PDT 2016


Author: matze
Date: Tue Apr 19 12:49:04 2016
New Revision: 266777

URL: http://llvm.org/viewvc/llvm-project?rev=266777&view=rev
Log:
Add 'check' target that runs lit after building the tests

Modified:
    test-suite/trunk/CMakeLists.txt
    test-suite/trunk/cmake/modules/SingleMultiSource.cmake

Modified: test-suite/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/CMakeLists.txt?rev=266777&r1=266776&r2=266777&view=diff
==============================================================================
--- test-suite/trunk/CMakeLists.txt (original)
+++ test-suite/trunk/CMakeLists.txt Tue Apr 19 12:49:04 2016
@@ -165,3 +165,15 @@ add_subdirectory(External)
 
 # Produce lit.site.cfg
 configure_file("${PROJECT_SOURCE_DIR}/lit.site.cfg.in" "${CMAKE_BINARY_DIR}/lit.site.cfg")
+
+find_program(TEST_SUITE_LIT NAMES "lit" "llvm-lit")
+set(TEST_SUITE_LIT_FLAGS "-sv" CACHE STRING "Flags used when running lit")
+mark_as_advanced(TEST_SUITE_LIT TEST_SUITE_LIT_FLAGS)
+mark_as_advanced(TEST_SUITE_LIT)
+get_property(TEST_SUITE_TARGETS GLOBAL PROPERTY TEST_SUITE_TARGETS)
+add_custom_target(check
+  COMMAND ${TEST_SUITE_LIT} ${TEST_SUITE_LIT_FLAGS} .
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS ${TEST_SUITE_TARGETS}
+  USES_TERMINAL
+  )

Modified: test-suite/trunk/cmake/modules/SingleMultiSource.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/SingleMultiSource.cmake?rev=266777&r1=266776&r2=266777&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/SingleMultiSource.cmake (original)
+++ test-suite/trunk/cmake/modules/SingleMultiSource.cmake Tue Apr 19 12:49:04 2016
@@ -150,6 +150,8 @@ macro(test_suite_add_executable name mai
       append_link_flags(${executable} -fprofile-instr-use=${executable_path}.profdata)
     endif()
 
+    set_property(GLOBAL APPEND PROPERTY TEST_SUITE_TARGETS ${executable})
+
     # Fall back to old style involving RUN_OPTIONS and STDIN_FILENAME if
     # llvm_test_run() was not called yet.
     if(NOT TESTSCRIPT)




More information about the llvm-commits mailing list