[PATCH] D35947: [lit] Fix order of checks in shtest-shell.py test

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 09:18:10 PDT 2017


modocache created this revision.

The new Python script added in https://reviews.llvm.org/rL309200 prints
to stdout, then to stderr, whereas the expectation in
`utils/lit/tests/Inputs/shtest-shell/redirects.txt` first checks for
the stderr output, and then the stdout output.

Reverse the expectation to fix the test. In addition, flush the output
to both stdout and stderr.


https://reviews.llvm.org/D35947

Files:
  utils/lit/tests/Inputs/shtest-shell/redirects.txt
  utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
  utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py


Index: utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
===================================================================
--- utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
+++ utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py
@@ -1,4 +1,6 @@
 #!/usr/bin/env python
 import sys
 sys.stdout.write("a line on stdout\n")
+sys.stdout.flush()
 sys.stderr.write("a line on stderr\n")
+sys.stderr.flush()
Index: utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
===================================================================
--- utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
+++ utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py
@@ -1,3 +1,4 @@
 #!/usr/bin/env python
 import sys
 sys.stderr.write("a line on stderr\n")
+sys.stderr.flush()
Index: utils/lit/tests/Inputs/shtest-shell/redirects.txt
===================================================================
--- utils/lit/tests/Inputs/shtest-shell/redirects.txt
+++ utils/lit/tests/Inputs/shtest-shell/redirects.txt
@@ -39,3 +39,4 @@
 # COMBINED-WRITE-NOT: not-present
 # COMBINED-WRITE: a line on stdout
 # COMBINED-WRITE: a line on stderr
+


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35947.108486.patch
Type: text/x-patch
Size: 1171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170727/a217dd20/attachment.bin>


More information about the llvm-commits mailing list