testers.testBuildFailure: Read last log line without final newline
This commit is contained in:
parent
6be5bb3172
commit
dbdd8fad26
@ -21,7 +21,7 @@ set -eu
|
||||
echo "testBuildFailure: Expecting non-zero exit from builder and args: ${*@Q}"
|
||||
|
||||
("$@" 2>&1) | @coreutils@/bin/tee $TMPDIR/testBuildFailure.log \
|
||||
| while read ln; do
|
||||
| while IFS= read -r ln; do
|
||||
echo "original builder: $ln"
|
||||
done
|
||||
|
||||
|
@ -29,15 +29,24 @@ lib.recurseIntoAttrs {
|
||||
happy = runCommand "testBuildFailure-happy" {
|
||||
failed = testers.testBuildFailure (runCommand "fail" {} ''
|
||||
echo ok-ish >$out
|
||||
|
||||
echo failing though
|
||||
echo also stderr 1>&2
|
||||
echo 'line\nwith-\bbackslashes'
|
||||
printf "incomplete line - no newline"
|
||||
|
||||
exit 3
|
||||
'');
|
||||
} ''
|
||||
grep -F 'ok-ish' $failed/result
|
||||
|
||||
grep -F 'failing though' $failed/testBuildFailure.log
|
||||
grep -F 'also stderr' $failed/testBuildFailure.log
|
||||
grep -F 'ok-ish' $failed/result
|
||||
grep -F 'line\nwith-\bbackslashes' $failed/testBuildFailure.log
|
||||
grep -F 'incomplete line - no newline' $failed/testBuildFailure.log
|
||||
|
||||
[[ 3 = $(cat $failed/testBuildFailure.exit) ]]
|
||||
|
||||
touch $out
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user