Skip to content

Commit 8d4710d

Browse files
Yongjie2017H. Peter Anvin
authored andcommitted
ffmpegtest: fix variable rev change in a subshell does not impact parent
Error status would get lost. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent 57bf1b7 commit 8d4710d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/ffmpegtest.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,24 @@ for x in $(grep -o -P "\-o .*\.o" $logfile | sed -e 's/-o //' | grep -v "/ffconf
6060
do
6161
if ! [ -f ${x}.1 ]; then
6262
echo file ${x}.1 does not exist
63-
rev=1
6463
fi
6564

6665
if ! [ -f ${x}.2 ]; then
6766
echo file ${x}.2 does not exist
68-
rev=1
6967
fi
7068

7169
objdump -d ${x}.1 | tail -n +4 >/tmp/1.dump
7270
objdump -d ${x}.2 | tail -n +4 >/tmp/2.dump
7371
if ! diff /tmp/1.dump /tmp/2.dump >/dev/null; then
7472
echo [differs] $x
7573
#diff /tmp/1.dump /tmp/2.dump
76-
rev=1
7774
else
7875
echo [matches] $x
7976
fi
8077
rm -f /tmp/1.dump /tmp/2.dump
8178
done
8279
} | tee "$here/results"
8380

81+
rev=$(grep -e " does not exist" -e "\[differs\]" $here/results >/dev/null)
82+
8483
exit $rev

0 commit comments

Comments
 (0)