Skip to content

Commit fe3f6c6

Browse files
authored
[Clang] Propagate 'SystemDrive' environment variable for unit tests (#90478)
On Windows, running unit tests by directly invoking `llvm-lit.py` (e.g. `python3 llvm-lit.py clang/test/Unit`) may create a folder named `%SystemDrive%` in the current working directory. This appears to happen because `lit.cfg.py` in `clang/test/Unit` does not propagate the `SystemDrive` environment variable.
1 parent f9d4d54 commit fe3f6c6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

clang/test/Unit/lit.cfg.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,9 @@
2525

2626
# Propagate the temp directory. Windows requires this because it uses \Windows\
2727
# if none of these are present.
28-
if "TMP" in os.environ:
29-
config.environment["TMP"] = os.environ["TMP"]
30-
if "TEMP" in os.environ:
31-
config.environment["TEMP"] = os.environ["TEMP"]
32-
33-
if "HOME" in os.environ:
34-
config.environment["HOME"] = os.environ["HOME"]
28+
for v in ["TMP", "TEMP", "HOME", "SystemDrive"]:
29+
if v in os.environ:
30+
config.environment[v] = os.environ[v]
3531

3632
# Propagate sanitizer options.
3733
for var in [

0 commit comments

Comments
 (0)