[Lldb-commits] [lldb] r330740 - [lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and windows server
Aaron Smith via lldb-commits
lldb-commits at lists.llvm.org
Tue Apr 24 10:08:05 PDT 2018
Author: asmith
Date: Tue Apr 24 10:08:05 2018
New Revision: 330740
URL: http://llvm.org/viewvc/llvm-project?rev=330740&view=rev
Log:
[lit, lldbsuite] Update the lldbsuite to correctly run tests on windows and windows server
Summary:
The new script to run the lldbtests as part of lit invokes each test by calling dotest.py, however, we cannot rely on the system to always correctly interpret the script as python causing the tests to be unresolved on windows (at least). To fix this, we need to make sure that the first parameter in the command line is the python executable itself.
In Makefile.rules, there are a number of windows specific definitions that rely on the HOST_OS being set as Windows_NT but the logic detecting the OS currently does not detect server versions of windows correctly. This change updates the logic to detect windows server as well.
Reviewers: asmith, labath, JDevlieghere, zturner
Reviewed By: JDevlieghere, zturner
Subscribers: zturner, llvm-commits
Differential Revision: https://reviews.llvm.org/D46020
Modified:
lldb/trunk/lit/Suite/lldbtest.py
lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
Modified: lldb/trunk/lit/Suite/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Suite/lldbtest.py?rev=330740&r1=330739&r2=330740&view=diff
==============================================================================
--- lldb/trunk/lit/Suite/lldbtest.py (original)
+++ lldb/trunk/lit/Suite/lldbtest.py Tue Apr 24 10:08:05 2018
@@ -41,7 +41,10 @@ class LLDBTest(TestFormat):
return (lit.Test.UNSUPPORTED, 'Test is unsupported')
testPath, testFile = os.path.split(test.getSourcePath())
- cmd = self.dotest_cmd + [testPath, '-p', testFile]
+ # On Windows, the system does not always correctly interpret shebang lines.
+ # To make sure we can execute the tests, add python exe as the first parameter
+ # of the command.
+ cmd = [sys.executable] + self.dotest_cmd + [testPath, '-p', testFile]
try:
out, err, exitCode = lit.util.executeCommand(
Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=330740&r1=330739&r2=330740&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Tue Apr 24 10:08:05 2018
@@ -36,13 +36,13 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)../../.
#----------------------------------------------------------------------
# If OS is not defined, use 'uname -s' to determine the OS name.
#
-# uname on Windows gives "windows32", but most environments standardize
-# on "Windows_NT", so we'll make it consistent here. When running
-# tests from Visual Studio, the environment variable isn't inherited
-# all the way down to the process spawned for make.
+# uname on Windows gives "windows32" or "server version windows32", but most
+# environments standardize on "Windows_NT", so we'll make it consistent here.
+# When running tests from Visual Studio, the environment variable isn't
+# inherited all the way down to the process spawned for make.
#----------------------------------------------------------------------
HOST_OS = $(shell uname -s)
-ifeq "$(HOST_OS)" "windows32"
+ifneq (,$(findstring windows32,$(HOST_OS)))
HOST_OS = Windows_NT
endif
ifeq "$(OS)" ""
More information about the lldb-commits
mailing list