[libcxx-commits] [libcxx] 39bbfb7 - [libc++] Use the internal Lit shell to run the tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 3 11:44:50 PDT 2021


Author: Louis Dionne
Date: 2021-05-03T14:44:42-04:00
New Revision: 39bbfb77264a4a7a216921c2b70a30ba0f27eb56

URL: https://github.com/llvm/llvm-project/commit/39bbfb77264a4a7a216921c2b70a30ba0f27eb56
DIFF: https://github.com/llvm/llvm-project/commit/39bbfb77264a4a7a216921c2b70a30ba0f27eb56.diff

LOG: [libc++] Use the internal Lit shell to run the tests

This makes the libc++ tests more portable -- almost all of them should
now work on Windows, except for some tests that assume a shell is
available on the target. We should probably provide a way to exclude
those anyway for the purpose of running tests on embedded targets.

Differential Revision: https://reviews.llvm.org/D89495

Added: 
    

Modified: 
    libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
    libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
    libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
    libcxx/utils/libcxx/test/format.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp b/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
index 6fa65a4175244..ba7458b5a280e 100644
--- a/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
+++ b/libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp
@@ -6,6 +6,11 @@
 //
 //===----------------------------------------------------------------------===//
 
+// This test greps for %t, which is expanded to a path with backslashes. When
+// that is passed to grep, those backslashes would have to be escaped, which we
+// don't do right now.
+// UNSUPPORTED: windows
+
 // Make sure that substitutions are performed inside additional compiler flags.
 
 // ADDITIONAL_COMPILE_FLAGS: -I %t.1

diff  --git a/libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp b/libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
index ce5cd4f03349a..4be0c05c4f076 100644
--- a/libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
+++ b/libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
@@ -10,4 +10,4 @@
 
 // Make sure the test DOES NOT pass if it fails to run
 
-// RUN: exit 1
+// RUN: false

diff  --git a/libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp b/libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
index 9f2d58236f1be..1d8747c719484 100644
--- a/libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
+++ b/libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
@@ -8,4 +8,4 @@
 
 // Make sure the test passes if it succeeds to run
 
-// RUN: exit 0
+// RUN: true

diff  --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 2be7d4c59da20..72f6d36250379 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -64,9 +64,7 @@ def parseScript(test, preamble):
 
     # Get the default substitutions
     tmpDir, tmpBase = _getTempPaths(test)
-    useExternalSh = True
-    substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase,
-                                                           normalize_slashes=useExternalSh)
+    substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
 
     # Check base substitutions and add the %{build} and %{run} convenience substitutions
     _checkBaseSubstitutions(substitutions)
@@ -305,5 +303,5 @@ def _executeShTest(self, test, litConfig, steps):
             return lit.Test.Result(lit.Test.XFAIL if test.isExpectedToFail() else lit.Test.PASS)
         else:
             _, tmpBase = _getTempPaths(test)
-            useExternalSh = True
+            useExternalSh = False
             return lit.TestRunner._runShTest(test, litConfig, useExternalSh, script, tmpBase)


        


More information about the libcxx-commits mailing list