mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
Factor signal checks out of test scripts
Several test scripts now have some code to check for a program returning a signal, and reporting a suitable failure. This patch moves this duplicated code into a helper function in tests.sh. At the same time we remove a bashism found in the current copies (using the non portablr $[ ] construct for arithmetic). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
a90b5b1491
commit
c879a8a28b
4 changed files with 13 additions and 16 deletions
|
@ -29,19 +29,14 @@ ret="$?"
|
|||
if [ "$ret" -ne 0 -a "$expect" = "ERR" ]; then
|
||||
PASS
|
||||
fi
|
||||
if [ "$ret" -gt 127 ]; then
|
||||
signame=$(kill -l $[ret - 128])
|
||||
FAIL "Killed by SIG$signame"
|
||||
fi
|
||||
|
||||
FAIL_IF_SIGNAL $ret
|
||||
|
||||
# Now fdtget to read the value
|
||||
verbose_run_log "$LOG" $VALGRIND "$DTGET" "$dtb" "$node" "$property" $flags
|
||||
ret="$?"
|
||||
|
||||
if [ "$ret" -gt 127 ]; then
|
||||
signame=$(kill -l $[ret - 128])
|
||||
FAIL "Killed by SIG$signame"
|
||||
fi
|
||||
FAIL_IF_SIGNAL $ret
|
||||
|
||||
diff $EXPECT $LOG
|
||||
ret="$?"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue