Skip to content

Commit 39bbfb7

Browse files
committed
[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
1 parent 84f0bb6 commit 39bbfb7

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

libcxx/test/libcxx/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
// This test greps for %t, which is expanded to a path with backslashes. When
10+
// that is passed to grep, those backslashes would have to be escaped, which we
11+
// don't do right now.
12+
// UNSUPPORTED: windows
13+
914
// Make sure that substitutions are performed inside additional compiler flags.
1015

1116
// ADDITIONAL_COMPILE_FLAGS: -I %t.1

libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010

1111
// Make sure the test DOES NOT pass if it fails to run
1212

13-
// RUN: exit 1
13+
// RUN: false

libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
// Make sure the test passes if it succeeds to run
1010

11-
// RUN: exit 0
11+
// RUN: true

libcxx/utils/libcxx/test/format.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def parseScript(test, preamble):
6464

6565
# Get the default substitutions
6666
tmpDir, tmpBase = _getTempPaths(test)
67-
useExternalSh = True
68-
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase,
69-
normalize_slashes=useExternalSh)
67+
substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase)
7068

7169
# Check base substitutions and add the %{build} and %{run} convenience substitutions
7270
_checkBaseSubstitutions(substitutions)
@@ -305,5 +303,5 @@ def _executeShTest(self, test, litConfig, steps):
305303
return lit.Test.Result(lit.Test.XFAIL if test.isExpectedToFail() else lit.Test.PASS)
306304
else:
307305
_, tmpBase = _getTempPaths(test)
308-
useExternalSh = True
306+
useExternalSh = False
309307
return lit.TestRunner._runShTest(test, litConfig, useExternalSh, script, tmpBase)

0 commit comments

Comments
 (0)