[libcxx-commits] [PATCH] D89495: [libc++] Use the internal Lit shell to run the tests

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 23 13:46:19 PDT 2021


ldionne updated this revision to Diff 340156.
ldionne added a comment.

Rebase onto main


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89495/new/

https://reviews.llvm.org/D89495

Files:
  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


Index: libcxx/utils/libcxx/test/format.py
===================================================================
--- libcxx/utils/libcxx/test/format.py
+++ libcxx/utils/libcxx/test/format.py
@@ -64,9 +64,7 @@
 
     # 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)
@@ -240,7 +238,7 @@
             return self._executeShTest(test, litConfig, steps)
         elif filename.endswith('.compile.fail.cpp'):
             steps = [
-                "%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
+                "%dbg(COMPILED WITH) not %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
             ]
             return self._executeShTest(test, litConfig, steps)
         elif filename.endswith('.link.pass.cpp'):
@@ -251,7 +249,7 @@
         elif filename.endswith('.link.fail.cpp'):
             steps = [
                 "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -c -o %t.o",
-                "%dbg(LINKED WITH) ! %{cxx} %t.o %{flags} %{link_flags} -o %t.exe"
+                "%dbg(LINKED WITH) not %{cxx} %t.o %{flags} %{link_flags} -o %t.exe"
             ]
             return self._executeShTest(test, litConfig, steps)
         elif filename.endswith('.verify.cpp'):
@@ -282,7 +280,7 @@
                 ]
             else:
                 steps = [
-                    "%dbg(COMPILED WITH) ! %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
+                    "%dbg(COMPILED WITH) not %{cxx} %s %{flags} %{compile_flags} -fsyntax-only"
                 ]
             return self._executeShTest(test, litConfig, steps)
         else:
@@ -305,5 +303,5 @@
             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)
Index: libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
===================================================================
--- libcxx/test/libcxx/selftest/sh.cpp/run-success.sh.cpp
+++ 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
Index: libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
===================================================================
--- libcxx/test/libcxx/selftest/sh.cpp/run-error.sh.cpp
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89495.340156.patch
Type: text/x-patch
Size: 3075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210423/f56e4b28/attachment-0001.bin>


More information about the libcxx-commits mailing list