[llvm] r309200 - [lit] Fix shtest-shell and max-failures lit tests on Windows
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 26 15:21:25 PDT 2017
Author: rnk
Date: Wed Jul 26 15:21:25 2017
New Revision: 309200
URL: http://llvm.org/viewvc/llvm-project?rev=309200&view=rev
Log:
[lit] Fix shtest-shell and max-failures lit tests on Windows
Rewrite the write-to-stderr.sh and write-to-stdout-and-stderr.sh shell
scripts as python scripts and call python on them.
Fixes PR33940
Added:
llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
Removed:
llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
Modified:
llvm/trunk/utils/lit/tests/Inputs/shtest-shell/redirects.txt
llvm/trunk/utils/lit/tests/max-failures.py
llvm/trunk/utils/lit/tests/shtest-shell.py
Modified: llvm/trunk/utils/lit/tests/Inputs/shtest-shell/redirects.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-shell/redirects.txt?rev=309200&r1=309199&r2=309200&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-shell/redirects.txt (original)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-shell/redirects.txt Wed Jul 26 15:21:25 2017
@@ -17,13 +17,13 @@
# Check stderr redirect (2> and 2>>).
#
# RUN: echo "not-present" > %t.stderr-write
-# RUN: %S/write-to-stderr.sh 2> %t.stderr-write
+# RUN: python %S/write-to-stderr.py 2> %t.stderr-write
# RUN: FileCheck --check-prefix=STDERR-WRITE < %t.stderr-write %s
#
# STDERR-WRITE-NOT: not-present
# STDERR-WRITE: a line on stderr
#
-# RUN: %S/write-to-stderr.sh 2>> %t.stderr-write
+# RUN: python %S/write-to-stderr.py 2>> %t.stderr-write
# RUN: FileCheck --check-prefix=STDERR-APPEND < %t.stderr-write %s
#
# STDERR-APPEND: a line on stderr
@@ -33,7 +33,7 @@
# Check combined redirect (&>).
#
# RUN: echo "not-present" > %t.combined
-# RUN: %S/write-to-stdout-and-stderr.sh &> %t.combined
+# RUN: python %S/write-to-stdout-and-stderr.py &> %t.combined
# RUN: FileCheck --check-prefix=COMBINED-WRITE < %t.combined %s
#
# COMBINED-WRITE-NOT: not-present
Added: llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py?rev=309200&view=auto
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py (added)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py Wed Jul 26 15:21:25 2017
@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+import sys
+sys.stderr.write("a line on stderr\n")
Removed: llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh?rev=309199&view=auto
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh (original)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh (removed)
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "a line on stderr" 1>&2
Added: llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py?rev=309200&view=auto
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py (added)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py Wed Jul 26 15:21:25 2017
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+import sys
+sys.stdout.write("a line on stdout\n")
+sys.stderr.write("a line on stderr\n")
Removed: llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh?rev=309199&view=auto
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh (original)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh (removed)
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-echo "a line on stdout"
-echo "a line on stderr" 1>&2
Modified: llvm/trunk/utils/lit/tests/max-failures.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/max-failures.py?rev=309200&r1=309199&r2=309200&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/max-failures.py (original)
+++ llvm/trunk/utils/lit/tests/max-failures.py Wed Jul 26 15:21:25 2017
@@ -1,8 +1,5 @@
# Check the behavior of --max-failures option.
#
-# PR33941
-# XFAIL: windows
-#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out
# RUN: not %{lit} --max-failures=1 -j 1 -v %{inputs}/shtest-shell >> %t.out
# RUN: not %{lit} --max-failures=2 -j 1 -v %{inputs}/shtest-shell >> %t.out
Modified: llvm/trunk/utils/lit/tests/shtest-shell.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/shtest-shell.py?rev=309200&r1=309199&r2=309200&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/shtest-shell.py (original)
+++ llvm/trunk/utils/lit/tests/shtest-shell.py Wed Jul 26 15:21:25 2017
@@ -1,8 +1,5 @@
# Check the internal shell handling component of the ShTest format.
#
-# PR33940
-# XFAIL: windows
-#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out
# RUN: FileCheck --input-file %t.out %s
#
More information about the llvm-commits
mailing list