[llvm-commits] [llvm] r149932 - in /llvm/trunk/utils/lit/lit: LitConfig.py TestingConfig.py

Andrew Trick atrick at apple.com
Mon Feb 6 15:34:53 PST 2012


Author: atrick
Date: Mon Feb  6 17:34:52 2012
New Revision: 149932

URL: http://llvm.org/viewvc/llvm-project?rev=149932&view=rev
Log:
This is a small patch with a couple of improvements for running lit with --debug:

1. Added a status note when a config file is loaded directly with load_config. This helps notice loads of lit.cfg from lit.site.cfg
2. Added a status note on the result of a config load. Previously, it was just notifying that it tries to load a config file. Now it will also say whether the load succeeded or the file wasn't found

The two changes give better visibility into which config files were actually loaded by lit. The effect is only on --debug runs.

Patch by Eli Bendersky!

Modified:
    llvm/trunk/utils/lit/lit/LitConfig.py
    llvm/trunk/utils/lit/lit/TestingConfig.py

Modified: llvm/trunk/utils/lit/lit/LitConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/LitConfig.py?rev=149932&r1=149931&r2=149932&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/LitConfig.py (original)
+++ llvm/trunk/utils/lit/lit/LitConfig.py Mon Feb  6 17:34:52 2012
@@ -61,6 +61,8 @@
         """load_config(config, path) - Load a config object from an alternate
         path."""
         from TestingConfig import TestingConfig
+        if self.debug:
+            self.note('load_config from %r' % path)
         return TestingConfig.frompath(path, config.parent, self,
                                       mustExist = True,
                                       config = config)

Modified: llvm/trunk/utils/lit/lit/TestingConfig.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/TestingConfig.py?rev=149932&r1=149931&r2=149932&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/TestingConfig.py (original)
+++ llvm/trunk/utils/lit/lit/TestingConfig.py Mon Feb  6 17:34:52 2012
@@ -50,14 +50,19 @@
             cfg_globals['__file__'] = path
             try:
                 exec f in cfg_globals
+                if litConfig.debug:
+                    litConfig.note('... loaded config %r' % path)
             except SystemExit,status:
                 # We allow normal system exit inside a config file to just
                 # return control without error.
                 if status.args:
                     raise
             f.close()
-        elif mustExist:
-            litConfig.fatal('unable to load config from %r ' % path)
+        else:
+            if mustExist:
+                litConfig.fatal('unable to load config from %r ' % path)
+            elif litConfig.debug:
+                litConfig.note('... config not found  - %r' %path)
 
         config.finish(litConfig)
         return config





More information about the llvm-commits mailing list