[Lldb-commits] [lldb] [lldb][tests] Transfer some environment variables into API tests on Windows platform. (PR #93366)

via lldb-commits lldb-commits at lists.llvm.org
Fri May 24 20:29:21 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Vladimir Vereschaka (vvereschaka)

<details>
<summary>Changes</summary>

These environment variables avoid some side effects during execution of the remote API tests on Windows platform.

One of the side effect is a creating of weird folders, such as `<test-root-dir>\%SystemDrive%\...`, within the test directory.

---
Full diff: https://github.com/llvm/llvm-project/pull/93366.diff


1 Files Affected:

- (modified) lldb/test/API/lit.cfg.py (+19) 


``````````diff
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..7d38ee0ec098c 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -313,3 +313,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]

``````````

</details>


https://github.com/llvm/llvm-project/pull/93366


More information about the lldb-commits mailing list