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

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


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

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.

>From 5f79f5fbf6679da020266d655ced91389215d851 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka <vvereschaka at accesssoftek.com>
Date: Fri, 24 May 2024 20:19:54 -0700
Subject: [PATCH] [lldb][tests] Transfer some environment variables into API
 tests on Windows platform.

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.
---
 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 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]



More information about the lldb-commits mailing list