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
diff --git a/src/test/shell/integration/build_event_stream_test.sh b/src/test/shell/integration/build_event_stream_test.sh
index 4dfa85e..ec59bc3 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 @@
# 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"