Clean up invocation of fdt{get,put} tests

This patch cleans up how the fdtget and fdtput tests are invoked.
Specifically we no longer hide the full command lines with a wrapper
function - this makes it possible to distinguish fdtget from similar
fdtput tests and makes it easier to work out how to manually invoke an
individual failing test.

In addition, we remove the testing for errors from the
fdt{get,put}-runtest.sh script, instead using an internal wrapper
analagous to run_wrap_test which can test for any program invocation
that's expected to return an error.

For a couple of the fdtput tests this would result in printing out
ludicrously large command lines.  Therefore we introduce a new
mechanism to cut those down to something reasonable.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2012-02-03 16:12:07 +11:00 committed by Jon Loeliger
parent c879a8a28b
commit 15b23d21a6
4 changed files with 103 additions and 85 deletions

View file

@ -14,7 +14,7 @@ rm -f $LOG $EXPECT
trap "rm -f $LOG $EXPECT" 0
expect="$1"
echo "$expect" >$EXPECT
echo $expect >$EXPECT
dtb="$2"
node="$3"
property="$4"
@ -23,20 +23,10 @@ shift 5
value="$@"
# First run fdtput
verbose_run $VALGRIND "$DTPUT" "$dtb" "$node" "$property" $value $flags
ret="$?"
if [ "$ret" -ne 0 -a "$expect" = "ERR" ]; then
PASS
fi
FAIL_IF_SIGNAL $ret
verbose_run_check $VALGRIND "$DTPUT" "$dtb" "$node" "$property" $value $flags
# Now fdtget to read the value
verbose_run_log "$LOG" $VALGRIND "$DTGET" "$dtb" "$node" "$property" $flags
ret="$?"
FAIL_IF_SIGNAL $ret
verbose_run_log_check "$LOG" $VALGRIND "$DTGET" "$dtb" "$node" "$property" $flags
diff $EXPECT $LOG
ret="$?"