aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-09-29 14:14:18 -0400
committerGravatar John Cater <jcater@google.com>2017-09-29 15:09:57 -0400
commit5cc6246d429f7d9119b97ce263b4fd6893222e92 (patch)
tree8e4d2751941546cb7485d52ad76dc014885fb479
parente1d2e39bdaf895a7d7f611d7613df27929373a19 (diff)
build_event_stream_test: fix usage of ed(1)
Unfortunately the various ed(1)s are different in subtle ways. The difference that hit us here is the different treatment of the implicit 'e' command when ed is started with a file as argument; GNU ed writes the answer of that command (i.e., the number of bytes read) on stderr, whereas ed on FreeBSD writes it on stdout. So, let's merge the two output channels and throw away the first answer explicitly. Fixes #3842. Change-Id: I4ef394957cdc316f896b54ca218d4f118465caff PiperOrigin-RevId: 170506490
-rwxr-xr-xsrc/test/shell/integration/build_event_stream_test.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 4dfa85ecc9..ec59bc3ed1 100755
--- a/src/test/shell/integration/build_event_stream_test.sh
+++ b/src/test/shell/integration/build_event_stream_test.sh
@@ -664,7 +664,9 @@ function test_alias() {
# there would be no event for alias:it. So we can check the correct reporting
# by checking for aborted events.
expect_not_log 'aborted'
- (echo 'g/^completed/?label?p'; echo 'q') | ed "${TEST_log}" > completed_labels
+
+ (echo 'g/^completed/?label?p'; echo 'q') | ed "${TEST_log}" 2>&1 | tail -n +2 > completed_labels
+ cat completed_labels
grep -q '//alias:it' completed_labels || fail "//alias:it not completed"
grep -q '//alias/actual:it' completed_labels \
|| fail "//alias/actual:it not completed"