2017-11-13 04:52:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
run_test() {
|
|
|
|
$@
|
|
|
|
[ $? -ne 0 ] && result=$((result+1))
|
|
|
|
}
|
2016-07-03 15:40:34 +00:00
|
|
|
|
2017-11-27 03:25:55 +00:00
|
|
|
result=0
|
|
|
|
|
2017-05-19 02:09:25 +00:00
|
|
|
# Run all tests that the standard sandbox build can support
|
2017-11-13 04:52:10 +00:00
|
|
|
run_test ./test/py/test.py --bd sandbox --build
|
2017-05-19 02:09:25 +00:00
|
|
|
|
|
|
|
# Run tests which require sandbox_spl
|
2018-05-16 07:10:24 +00:00
|
|
|
run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
|
2017-05-19 02:09:25 +00:00
|
|
|
|
|
|
|
# Run tests for the flat DT version of sandbox
|
|
|
|
./test/py/test.py --bd sandbox_flattree --build
|
2017-11-13 04:52:10 +00:00
|
|
|
|
2018-10-02 03:12:37 +00:00
|
|
|
# Set up a path to dtc (device-tree compiler) and libfdt.py, a library it
|
|
|
|
# provides and which is built by the sandbox_spl config.
|
2017-12-24 19:12:08 +00:00
|
|
|
DTC_DIR=build-sandbox_spl/scripts/dtc
|
2018-10-02 03:12:37 +00:00
|
|
|
export PYTHONPATH=${DTC_DIR}/pylibfdt
|
|
|
|
export DTC=${DTC_DIR}/dtc
|
2017-12-24 19:12:08 +00:00
|
|
|
|
2018-10-02 03:12:37 +00:00
|
|
|
run_test ./tools/binman/binman -t
|
2017-11-27 03:25:57 +00:00
|
|
|
run_test ./tools/patman/patman --test
|
2017-11-27 03:25:58 +00:00
|
|
|
run_test ./tools/buildman/buildman -t
|
2018-10-02 03:12:37 +00:00
|
|
|
run_test ./tools/dtoc/dtoc -t
|
2017-11-27 03:25:56 +00:00
|
|
|
|
2017-11-27 03:26:01 +00:00
|
|
|
# This needs you to set up Python test coverage tools.
|
|
|
|
# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
|
2018-07-06 16:27:14 +00:00
|
|
|
# $ sudo apt-get install python-pytest python-coverage
|
2018-10-02 03:12:37 +00:00
|
|
|
run_test ./tools/binman/binman -T
|
|
|
|
run_test ./tools/dtoc/dtoc -T
|
|
|
|
run_test ./tools/dtoc/test_fdt -T
|
2017-11-27 03:26:01 +00:00
|
|
|
|
2017-11-13 04:52:10 +00:00
|
|
|
if [ $result == 0 ]; then
|
|
|
|
echo "Tests passed!"
|
|
|
|
else
|
|
|
|
echo "Tests FAILED"
|
|
|
|
exit 1
|
|
|
|
fi
|