[libcxx-commits] [libcxxabi] 6f69318 - [runtimes] Allow passing Lit parameters through CMake

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 9 09:45:15 PDT 2020


Author: Louis Dionne
Date: 2020-07-09T12:45:00-04:00
New Revision: 6f69318c7248275b509ecf0f88eb2ba725aaeb82

URL: https://github.com/llvm/llvm-project/commit/6f69318c7248275b509ecf0f88eb2ba725aaeb82
DIFF: https://github.com/llvm/llvm-project/commit/6f69318c7248275b509ecf0f88eb2ba725aaeb82.diff

LOG: [runtimes] Allow passing Lit parameters through CMake

This allows passing parameters to the test suites without using
LLVM_LIT_ARGS. The problem is that we sometimes want to set some
Lit arguments on the CMake command line, but the Lit parameters in
a CMake cache file. If the only knob to do that is LLVM_LIT_ARGS,
the command-line entry overrides the cache one, and the parameters
set by the cache are ignored.

This fixes a current issue with the build bots that they completely
ignore the 'std' param set by Lit, because other Lit arguments are
provided via LLVM_LIT_ARGS on the CMake command-line.

Added: 
    

Modified: 
    libcxx/CMakeLists.txt
    libcxx/cmake/caches/Generic-cxx03.cmake
    libcxx/cmake/caches/Generic-cxx11.cmake
    libcxx/cmake/caches/Generic-cxx14.cmake
    libcxx/cmake/caches/Generic-cxx17.cmake
    libcxx/cmake/caches/Generic-cxx2a.cmake
    libcxx/test/CMakeLists.txt
    libcxxabi/CMakeLists.txt
    libcxxabi/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index d215ef6f89d9..310ca5f56c46 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -111,6 +111,8 @@ option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library
 option(LIBCXX_TEST_GDB_PRETTY_PRINTERS "Test gdb pretty printers." OFF)
 set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
     "The Lit testing configuration to use when running the tests.")
+set(LIBCXX_TEST_PARAMS "" CACHE STRING
+    "A list of parameters to run the Lit test suite with.")
 
 # Benchmark options -----------------------------------------------------------
 option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependencies" ON)

diff  --git a/libcxx/cmake/caches/Generic-cxx03.cmake b/libcxx/cmake/caches/Generic-cxx03.cmake
index d1d67d86d74a..5edb1c4cd2d1 100644
--- a/libcxx/cmake/caches/Generic-cxx03.cmake
+++ b/libcxx/cmake/caches/Generic-cxx03.cmake
@@ -1 +1,2 @@
-set(LLVM_LIT_ARGS "--param std=c++03" CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "std=c++03" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/cmake/caches/Generic-cxx11.cmake b/libcxx/cmake/caches/Generic-cxx11.cmake
index e203c6aeaf29..f0f89c44d40c 100644
--- a/libcxx/cmake/caches/Generic-cxx11.cmake
+++ b/libcxx/cmake/caches/Generic-cxx11.cmake
@@ -1 +1,2 @@
-set(LLVM_LIT_ARGS "--param std=c++11" CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "std=c++11" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/cmake/caches/Generic-cxx14.cmake b/libcxx/cmake/caches/Generic-cxx14.cmake
index b1bf1244b510..29c688d926b4 100644
--- a/libcxx/cmake/caches/Generic-cxx14.cmake
+++ b/libcxx/cmake/caches/Generic-cxx14.cmake
@@ -1 +1,2 @@
-set(LLVM_LIT_ARGS "--param std=c++14" CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "std=c++14" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/cmake/caches/Generic-cxx17.cmake b/libcxx/cmake/caches/Generic-cxx17.cmake
index b23204729ced..35bac92070b8 100644
--- a/libcxx/cmake/caches/Generic-cxx17.cmake
+++ b/libcxx/cmake/caches/Generic-cxx17.cmake
@@ -1 +1,2 @@
-set(LLVM_LIT_ARGS "--param std=c++17" CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "std=c++17" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/cmake/caches/Generic-cxx2a.cmake b/libcxx/cmake/caches/Generic-cxx2a.cmake
index 31f1b76ab91f..1a07a99563dc 100644
--- a/libcxx/cmake/caches/Generic-cxx2a.cmake
+++ b/libcxx/cmake/caches/Generic-cxx2a.cmake
@@ -1 +1,2 @@
-set(LLVM_LIT_ARGS "--param std=c++2a" CACHE STRING "")
+set(LIBCXX_TEST_PARAMS "std=c++2a" CACHE STRING "")
+set(LIBCXXABI_TEST_PARAMS "${LIBCXX_TEST_PARAMS}" CACHE STRING "")

diff  --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt
index d4b84b85ac5d..b06984fc0ba9 100644
--- a/libcxx/test/CMakeLists.txt
+++ b/libcxx/test/CMakeLists.txt
@@ -103,7 +103,7 @@ if(LIBCXX_TEST_GDB_PRETTY_PRINTERS)
 endif()
 
 if (LIBCXX_INCLUDE_TESTS)
-  include(AddLLVM) # for configure_lit_site_cfg and add_lit_testsuite
+  include(AddLLVM) # for configure_lit_site_cfg and add_lit_target
 
   configure_lit_site_cfg(
     "${LIBCXX_TEST_CONFIG}"
@@ -114,10 +114,11 @@ if (LIBCXX_INCLUDE_TESTS)
     DEPENDS cxx ${LIBCXX_TEST_DEPS}
     COMMENT "Builds dependencies required to run the test suite.")
 
-  add_lit_testsuite(check-cxx
+  add_lit_target(check-cxx
     "Running libcxx tests"
     ${CMAKE_CURRENT_BINARY_DIR}
-    DEPENDS check-cxx-deps)
+    DEPENDS check-cxx-deps
+    PARAMS "${LIBCXX_TEST_PARAMS}")
 endif()
 
 if (LIBCXX_GENERATE_COVERAGE)

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index b6f1f0823bb6..8881a5018dc4 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -137,6 +137,8 @@ option(LIBCXXABI_HERMETIC_STATIC_LIBRARY
 
 set(LIBCXXABI_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING
     "The Lit testing configuration to use when running the tests.")
+set(LIBCXXABI_TEST_PARAMS "" CACHE STRING
+    "A list of parameters to run the Lit test suite with.")
 
 #===============================================================================
 # Configure System

diff  --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt
index b942b9c62e5d..8dcd65d9b4b4 100644
--- a/libcxxabi/test/CMakeLists.txt
+++ b/libcxxabi/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-include(AddLLVM) # for add_lit_testsuite
+include(AddLLVM) # for configure_lit_site_cfg and add_lit_target
 macro(pythonize_bool var)
   if (${var})
     set(${var} True)
@@ -76,6 +76,7 @@ configure_lit_site_cfg(
   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
   MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
 
-add_lit_testsuite(check-cxxabi "Running libcxxabi tests"
+add_lit_target(check-cxxabi "Running libcxxabi tests"
   ${CMAKE_CURRENT_BINARY_DIR}
-  DEPENDS ${LIBCXXABI_TEST_DEPS})
+  DEPENDS ${LIBCXXABI_TEST_DEPS}
+  PARAMS "${LIBCXXABI_TEST_PARAMS}")


        


More information about the libcxx-commits mailing list