[Lldb-commits] [lldb] [lldb] Transfer some environment variables into the tests on Windows build host (PR #115613)
Dmitry Vasilyev via lldb-commits
lldb-commits at lists.llvm.org
Sat Nov 9 09:13:07 PST 2024
https://github.com/slydiman created https://github.com/llvm/llvm-project/pull/115613
Some API tests (compiler calls) create a lot of garbage and cause unexpected behavior in case of Windows host and Linux target, e.g.
```
lldb/test/API/commands/process/attach/%SystemDrive%/
lldb/test/API/functionalities/deleted-executable/%SystemDrive%/
lldb/test/API/functionalities/exec/%SystemDrive%/
lldb/test/API/functionalities/load_unload/%SystemDrive%/
lldb/test/API/functionalities/target-new-solib-notifications/%SystemDrive%/
lldb/test/API/functionalities/thread/create_after_attach/%SystemDrive%/
```
It can be fixed by transfer some standard Windows environment variables into API tests.
>From 17b3338decd050612d0b804ef6d9966912b0950b Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev <dvassiliev at accesssoftek.com>
Date: Sat, 9 Nov 2024 21:11:16 +0400
Subject: [PATCH] [lldb] Transfer some environment variables into the tests on
Windows build host
Some API tests (compiler calls) create a lot of garbage and cause unexpected behavior in case of Windows host and Linux target, e.g.
```
lldb/test/API/commands/process/attach/%SystemDrive%/
lldb/test/API/functionalities/deleted-executable/%SystemDrive%/
lldb/test/API/functionalities/exec/%SystemDrive%/
lldb/test/API/functionalities/load_unload/%SystemDrive%/
lldb/test/API/functionalities/target-new-solib-notifications/%SystemDrive%/
lldb/test/API/functionalities/thread/create_after_attach/%SystemDrive%/
```
It can be fixed by transfer some standard Windows environment variables into API tests.
---
lldb/test/API/lit.cfg.py | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 6ef09f36a1907e..febf8dc3d19021 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -334,3 +334,22 @@ def delete_module_cache(path):
# Propagate XDG_CACHE_HOME
if "XDG_CACHE_HOME" in os.environ:
config.environment["XDG_CACHE_HOME"] = os.environ["XDG_CACHE_HOME"]
+
+# Transfer some environment variables into the tests on Windows build host.
+if platform.system() == "Windows":
+ for v in [
+ "SystemDrive",
+ "SystemRoot",
+ "ALLUSERSPROFILE",
+ "APPDATA",
+ "LOCALAPPDATA",
+ "USERDNSDOMAIN",
+ "USERDOMAIN",
+ "USERNAME",
+ "USERPROFILE",
+ "USERDOMAIN_ROAMINGPROFILE",
+ "COMPUTERNAME",
+ "ProgramData",
+ ]:
+ if v in os.environ:
+ config.environment[v] = os.environ[v]
More information about the lldb-commits
mailing list