[libcxx-commits] [libcxx] r371120 - Add testing infrastructure to check if gdb is available for testing.

Sterling Augustine via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 5 13:44:08 PDT 2019


Author: saugustine
Date: Thu Sep  5 13:44:08 2019
New Revision: 371120

URL: http://llvm.org/viewvc/llvm-project?rev=371120&view=rev
Log:
Add testing infrastructure to check if gdb is available for testing.

Reviewers: echristo, EricWF

Subscribers: mgorny, christof, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67194

Modified:
    libcxx/trunk/test/CMakeLists.txt
    libcxx/trunk/test/lit.site.cfg.in
    libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/CMakeLists.txt?rev=371120&r1=371119&r2=371120&view=diff
==============================================================================
--- libcxx/trunk/test/CMakeLists.txt (original)
+++ libcxx/trunk/test/CMakeLists.txt Thu Sep  5 13:44:08 2019
@@ -60,6 +60,14 @@ if (NOT DEFINED LIBCXX_TEST_DEPS)
   message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined")
 endif()
 
+find_program(LIBCXX_GDB gdb)
+if (LIBCXX_GDB)
+  set(LIBCXX_GDB "${LIBCXX_GDB}")
+  message(STATUS "gdb found: ${LIBCXX_GDB}")
+else()
+  message(STATUS "gdb not found. Disabling dependent tests.")
+endif()
+
 if (LIBCXX_INCLUDE_TESTS)
   include(AddLLVM) # for configure_lit_site_cfg and add_lit_testsuit
 
@@ -87,7 +95,6 @@ if (LIBCXX_GENERATE_COVERAGE)
   setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
 endif()
 
-
 if (LIBCXX_CONFIGURE_IDE)
   # Create dummy targets for each of the tests in the test suite, this allows
   # IDE's such as CLion to correctly highlight the tests because it knows

Modified: libcxx/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.site.cfg.in?rev=371120&r1=371119&r2=371120&view=diff
==============================================================================
--- libcxx/trunk/test/lit.site.cfg.in (original)
+++ libcxx/trunk/test/lit.site.cfg.in Thu Sep  5 13:44:08 2019
@@ -35,6 +35,7 @@ config.libcxxabi_shared         = @LIBCX
 config.cxx_ext_threads          = @LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY@
 config.pstl_src_root            = "@ParallelSTL_SOURCE_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
 config.pstl_obj_root            = "@ParallelSTL_BINARY_DIR@" if @LIBCXX_ENABLE_PARALLEL_ALGORITHMS@ else None
+config.libcxx_gdb               = "@LIBCXX_GDB@"
 
 # Let the main config do the real work.
 config.loaded_site_config = True

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=371120&r1=371119&r2=371120&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Thu Sep  5 13:44:08 2019
@@ -490,6 +490,10 @@ class Configuration(object):
             self.config.available_features.add('glibc-%s' % maj_v)
             self.config.available_features.add('glibc-%s.%s' % (maj_v, min_v))
 
+        if 'NOTFOUND' not in self.get_lit_conf('libcxx_gdb'):
+            self.config.available_features.add('libcxx_gdb')
+            self.cxx.libcxx_gdb = self.get_lit_conf('libcxx_gdb')
+
         # Support Objective-C++ only on MacOS and if the compiler supports it.
         if self.target_info.platform() == "darwin" and \
            self.target_info.is_host_macosx() and \
@@ -1072,6 +1076,8 @@ class Configuration(object):
         not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
         not_str = '%s %s ' % (pipes.quote(sys.executable), pipes.quote(not_py))
         sub.append(('not ', not_str))
+        if self.get_lit_conf('libcxx_gdb'):
+            sub.append(('%libcxx_gdb', self.get_lit_conf('libcxx_gdb')))
 
     def can_use_deployment(self):
         # Check if the host is on an Apple platform using clang.




More information about the libcxx-commits mailing list