summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-07-26 22:21:25 +0000
committerReid Kleckner <rnk@google.com>2017-07-26 22:21:25 +0000
commit6dac9134f93b1e146153986cd030d3e808437afd (patch)
tree9bb6d27c52f5a507353af4233417182ad821df54
parent709fb2bb10310576860c8eda9e3d8ef4e7dc11a0 (diff)
downloadbcm5719-llvm-6dac9134f93b1e146153986cd030d3e808437afd.tar.gz
bcm5719-llvm-6dac9134f93b1e146153986cd030d3e808437afd.zip
[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 llvm-svn: 309200
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt6
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py3
-rwxr-xr-xllvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py4
-rwxr-xr-xllvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh4
-rw-r--r--llvm/utils/lit/tests/max-failures.py3
-rw-r--r--llvm/utils/lit/tests/shtest-shell.py3
7 files changed, 10 insertions, 16 deletions
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt b/llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt
index 6be88b67ce1..2329955aa4c 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/redirects.txt
@@ -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
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
new file mode 100644
index 00000000000..aff94cd8b96
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+import sys
+sys.stderr.write("a line on stderr\n")
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
deleted file mode 100755
index ead3fd3ce37..00000000000
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "a line on stderr" 1>&2
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
new file mode 100644
index 00000000000..5c1849870b1
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
@@ -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")
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh b/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
deleted file mode 100755
index f20de5d9042..00000000000
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-echo "a line on stdout"
-echo "a line on stderr" 1>&2
diff --git a/llvm/utils/lit/tests/max-failures.py b/llvm/utils/lit/tests/max-failures.py
index 7a26b3cd038..5cc258dd08a 100644
--- a/llvm/utils/lit/tests/max-failures.py
+++ b/llvm/utils/lit/tests/max-failures.py
@@ -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
diff --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py
index 1a6d91eee22..18b80cd7d08 100644
--- a/llvm/utils/lit/tests/shtest-shell.py
+++ b/llvm/utils/lit/tests/shtest-shell.py
@@ -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
#
OpenPOWER on IntegriCloud