aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-05-13 11:06:33 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-05-13 11:10:05 +0000
commit49b3f8d687ae4ee26fd70393c86b2910572e4e45 (patch)
treecdcae0e46c8198177906b311e2de956a6ae07dde /src/test
parente0bfbca4a186969d6c3c4590ab963db7565d2b12 (diff)
Improve pass-through during build
If tests are run with --test_output=streamed, output has to be passed through before the end of the (overall) build. In this situation, enforcing a line-end to redraw the status bar messes up the output that is streamed through. Therefore, buffer stdout/stderr to full lines and pass them through without extra newlines added. -- Change-Id: I52d5dfbd1cb30a6ce2d7d2fd34658a606abcc277 Reviewed-on: https://bazel-review.googlesource.com/#/c/3620 MOS_MIGRATED_REVID=122248012
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/integration/experimental_ui_test.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/shell/integration/experimental_ui_test.sh b/src/test/shell/integration/experimental_ui_test.sh
index cfcb76f638..490d0fe747 100755
--- a/src/test/shell/integration/experimental_ui_test.sh
+++ b/src/test/shell/integration/experimental_ui_test.sh
@@ -46,6 +46,14 @@ EOF
exit 1
EOF
chmod 755 pkg/false.sh
+ cat > pkg/output.sh <<EOF
+#!/bin/sh
+`which echo` -n foo
+sleep 1
+`which echo` -n bar
+exit 0
+EOF
+ chmod 755 pkg/output.sh
cat > pkg/BUILD <<EOF
sh_test(
name = "true",
@@ -59,6 +67,10 @@ sh_test(
name = "false",
srcs = ["false.sh"],
)
+sh_test(
+ name = "output",
+ srcs = ["output.sh"],
+)
genrule(
name = "gentext",
outs = ["gentext.txt"],
@@ -208,5 +220,11 @@ function test_failure_scrollback_buffer {
expect_log '^'$'\x1b\[31m\x1b\[1mFAIL:'
}
+function test_streamed {
+ bazel test --experimental_ui --curses=yes --color=yes \
+ --nocache_test_results --test_output=streamed pkg:output >$TEST_log \
+ || fail "expected success"
+ expect_log 'foobar'
+}
run_suite "Integration tests for bazel's experimental UI"