Skip to content

Commit

Permalink
build_event_stream_test: fix usage of ed(1)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
aehlig authored and katre committed Sep 29, 2017
1 parent e1d2e39 commit 5cc6246
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/test/shell/integration/build_event_stream_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

2 comments on commit 5cc6246

@Teena000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Teena000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.