From 5a69de7528dcc5ad93b73e7ff62ba196d4e415be Mon Sep 17 00:00:00 2001 From: Brian Gesiak Date: Thu, 27 Jul 2017 16:50:40 +0000 Subject: [PATCH] [lit] Fix order of checks in shtest-shell.py test Summary: An expectation in `utils/lit/tests/Inputs/shtest-shell/redirects.txt` expects that first a string printed to stdout is seen, and then a string printed to stderr. Add `flush()` calls to ensure that stdout is printed before stderr, as expected. Reviewers: rnk, mgorny, jroelofs Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35947 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309292 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py | 4 ++++ .../tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py b/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py index aff94cd8b96..9463251d823 100644 --- a/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py +++ b/utils/lit/tests/Inputs/shtest-shell/write-to-stderr.py @@ -1,3 +1,7 @@ #!/usr/bin/env python + import sys + + sys.stderr.write("a line on stderr\n") +sys.stderr.flush() diff --git a/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py b/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py index 5c1849870b1..357089d4899 100644 --- a/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py +++ b/utils/lit/tests/Inputs/shtest-shell/write-to-stdout-and-stderr.py @@ -1,4 +1,10 @@ #!/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() -- 2.50.1