[libcxx-commits] [libcxx] f8239ee - [libc++] Reduce the verbosity when running the libc++ Lit configuration

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 30 09:03:31 PDT 2022


Author: Louis Dionne
Date: 2022-05-30T12:03:24-04:00
New Revision: f8239eec8decd3459d4f638b98c4f582add31263

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

LOG: [libc++] Reduce the verbosity when running the libc++ Lit configuration

We print the same information as before, however we do it with less
verbosity unless `--debug` is used.

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/newconfig.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/newconfig.py b/libcxx/utils/libcxx/test/newconfig.py
index 644438724f7eb..2ac5cf239d63d 100644
--- a/libcxx/utils/libcxx/test/newconfig.py
+++ b/libcxx/utils/libcxx/test/newconfig.py
@@ -13,6 +13,8 @@ def _getSubstitution(substitution, config):
   raise ValueError('Substitution {} is not in the config.'.format(substitution))
 
 def configure(parameters, features, config, lit_config):
+  note = lambda s: lit_config.note("({}) {}".format(config.name, s))
+
   # Apply the actions supplied by parameters to the configuration first, since
   # parameters are things that we request explicitly and which might influence
   # what features are implicitly made available next.
@@ -20,19 +22,24 @@ def configure(parameters, features, config, lit_config):
     actions = param.getActions(config, lit_config.params)
     for action in actions:
       action.applyTo(config)
-      lit_config.note("Applied '{}' as a result of parameter '{}'".format(
-        action.pretty(config, lit_config.params),
-        param.pretty(config, lit_config.params)))
+      if lit_config.debug:
+        note("Applied '{}' as a result of parameter '{}'".format(
+          action.pretty(config, lit_config.params),
+          param.pretty(config, lit_config.params)))
 
   # Then, apply the automatically-detected features.
   for feature in features:
     actions = feature.getActions(config)
     for action in actions:
       action.applyTo(config)
-      lit_config.note("Applied '{}' as a result of implicitly detected feature '{}'".format(
-        action.pretty(config, lit_config.params),
-        feature.pretty(config)))
+      if lit_config.debug:
+        note("Applied '{}' as a result of implicitly detected feature '{}'".format(
+          action.pretty(config, lit_config.params),
+          feature.pretty(config)))
 
   # Print the basic substitutions
   for sub in ('%{cxx}', '%{flags}', '%{compile_flags}', '%{link_flags}', '%{exec}'):
-    lit_config.note("Using {} substitution: '{}'".format(sub, _getSubstitution(sub, config)))
+    note("Using {} substitution: '{}'".format(sub, _getSubstitution(sub, config)))
+
+  # Print all available features
+  note("All available features: {}".format(', '.join(config.available_features)))


        


More information about the libcxx-commits mailing list