Skip to content
Snippets Groups Projects
Commit 2f52018c authored by Simon Glass's avatar Simon Glass
Browse files

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: default avatarSimon Glass <sjg@chromium.org>
parent d09682ef
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
#!/bin/bash
run_test() {
$@
[ $? -ne 0 ] && result=$((result+1))
echo "result $result"
}
# Run all tests that the standard sandbox build can support
./test/py/test.py --bd sandbox --build
run_test ./test/py/test.py --bd sandbox --build
# Run tests which require sandbox_spl
./test/py/test.py --bd sandbox_spl --build -k test/py/tests/test_ofplatdata.py
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment