[clang] 0292126 - [clang][lit] Make LIT aware of env CLANG_CRASH_DIAGNOSTICS_DIR.

Francesco Petrogalli via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 15:08:30 PDT 2023


Author: Francesco Petrogalli
Date: 2023-04-05T00:08:14+02:00
New Revision: 029212617ca8bdedd949d17bf2d33750605ea607

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

LOG: [clang][lit] Make LIT aware of env CLANG_CRASH_DIAGNOSTICS_DIR.

This is useful for retriving crash reports of LIT runs when the
temporary folder is not accessible.

Reviewed By: michaelplatings

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

Added: 
    

Modified: 
    clang/test/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index e9bfaf2e9677..7c5a55c8e313 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -284,6 +284,10 @@ def exclude_unsupported_files_for_aix(dirname):
         config.substitutions.append(('llvm-nm', 'env OBJECT_MODE=any llvm-nm'))
         config.substitutions.append(('llvm-ar', 'env OBJECT_MODE=any llvm-ar'))
 
+# Pass the crash diagnostic dir set in the os environment to LIT.
+if 'CLANG_CRASH_DIAGNOSTICS_DIR' in os.environ:
+    config.environment['CLANG_CRASH_DIAGNOSTICS_DIR'] = os.environ['CLANG_CRASH_DIAGNOSTICS_DIR']
+
 # It is not realistically possible to account for all options that could
 # possibly be present in system and user configuration files, so disable
 # default configs for the test runs.


        


More information about the cfe-commits mailing list