[llvm] a4b0100 - [llvm-config] Make tests more resiliant

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 08:04:42 PDT 2022


Author: Chris Bieneman
Date: 2022-10-18T10:04:34-05:00
New Revision: a4b010034f57b428acb3a57a767366eb40816173

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

LOG: [llvm-config] Make tests more resiliant

In some modes llvm-config issues an error if a requested library is not
available on the system. The in-tree lit tests do not add explicit
dependencies on all component libraries, instead relying on the
transitive dependencies of tools and other libraries.

This can result in some configurations where a component library may not
be used by any of the test dependencies, so it may not be generated
before the tests run. This occurs when optional components of the LLVM
build are excluded, or not included.

In the case where a component library is not generated two test caess
are currently failing. One which tests the shared library boolean flag,
and one which tests the system library requirements. Neither test
require the full set of LLVM libraries to be specifed, so in both cases
I've limited the requested library set to Support to make the tests more
robust.

Added: 
    

Modified: 
    llvm/test/tools/llvm-config/booleans.test
    llvm/test/tools/llvm-config/system-libs.test

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-config/booleans.test b/llvm/test/tools/llvm-config/booleans.test
index 6483db51da39e..c186374a60c46 100644
--- a/llvm/test/tools/llvm-config/booleans.test
+++ b/llvm/test/tools/llvm-config/booleans.test
@@ -21,7 +21,7 @@ CHECK-BUILD-SYSTEM: {{cmake|gn}}
 CHECK-BUILD-SYSTEM-NOT: error:
 CHECK-BUILD-SYSTEM-NOT: warning
 
-RUN: llvm-config --shared-mode 2>&1 | FileCheck --check-prefix=CHECK-SHARED-MODE %s
+RUN: llvm-config --shared-mode 2>&1 Support | FileCheck --check-prefix=CHECK-SHARED-MODE %s
 CHECK-SHARED-MODE: {{static|shared}}
 CHECK-SHARED-MODE-NOT: error:
 CHECK-SHARED-MODE-NOT: warning

diff  --git a/llvm/test/tools/llvm-config/system-libs.test b/llvm/test/tools/llvm-config/system-libs.test
index 9105d242e049a..708ce3ef99a42 100644
--- a/llvm/test/tools/llvm-config/system-libs.test
+++ b/llvm/test/tools/llvm-config/system-libs.test
@@ -1,4 +1,4 @@
-RUN: llvm-config --link-static --system-libs 2>&1 | FileCheck %s
+RUN: llvm-config --link-static --system-libs Support 2>&1 | FileCheck %s
 REQUIRES: static-libs
 UNSUPPORTED: system-windows
 CHECK: -l


        


More information about the llvm-commits mailing list