[clang][lit] Make LIT aware of env CLANG_CRASH_DIAGNOSTICS_DIR.
authorFrancesco Petrogalli <francesco.petrogalli@apple.com>
Tue, 4 Apr 2023 22:07:20 +0000 (00:07 +0200)
committerFrancesco Petrogalli <francesco.petrogalli@apple.com>
Tue, 4 Apr 2023 22:08:14 +0000 (00:08 +0200)
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

clang/test/lit.cfg.py

index e9bfaf2..7c5a55c 100644 (file)
@@ -284,6 +284,10 @@ if 'system-aix' in config.available_features:
         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.