u-boot-brain/test/run
Simon Glass 2f52018c3c test/run: Report and return failure
This script runs the tests but does not report failure. Also it always
returns an exit code of 0 even on failure.

Fix these problems by checking the result of each test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2017-11-22 18:05:38 -07:00

25 lines
515 B
Bash
Executable File

#!/bin/bash
run_test() {
$@
[ $? -ne 0 ] && result=$((result+1))
echo "result $result"
}
# Run all tests that the standard sandbox build can support
run_test ./test/py/test.py --bd sandbox --build
# Run tests which require sandbox_spl
run_test ./test/py/test.py --bd sandbox_spl --build -k \
test/py/tests/test_ofplatdata.py
# Run tests for the flat DT version of sandbox
./test/py/test.py --bd sandbox_flattree --build
if [ $result == 0 ]; then
echo "Tests passed!"
else
echo "Tests FAILED"
exit 1
fi