platform_external_dtc/tests/tests.sh
David Gibson 5ba0086bfd dtc: More detailed testing of tree checks
This patch modifies the dtc-checkfails.sh testcase wrapper so that
instead of testing just that dtc fails with a particular error code on
the sample input, it scans dtc's stderr output looking for a message
that dtc failed a specific check or checks.  This has several advantages:
	- It means we more precisely check dtc's checking behaviour
	- It means we can check for generation of warnings using the
same script
	- It means we can test cases where dtc should generate
multiple errors or warnings from different checks

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-06 09:15:19 -06:00

32 lines
393 B
Bash

# Common functions for shell testcases
PASS () {
echo "PASS"
exit 0
}
FAIL () {
echo "FAIL" "$@"
exit 2
}
DTC=../dtc
verbose_run () {
if [ -z "$QUIET_TEST" ]; then
"$@"
else
"$@" > /dev/null 2> /dev/null
fi
}
verbose_run_log () {
LOG="$1"
shift
"$@" &> "$LOG"
ret=$?
if [ -z "$QUIET_TEST" ]; then
cat "$LOG" >&2
fi
return $ret
}