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
|
|
|
|
2017-12-24 19:12:08 +00:00
|
|
|
DTC_DIR=build-sandbox_spl/scripts/dtc
|
|
|
|
|
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
|
2017-11-27 03:25:56 +00:00
|
|
|
./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
|
2017-12-24 19:12:08 +00:00
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc 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
|
2017-12-24 19:12:08 +00:00
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
|
2017-11-27 03:26:01 +00:00
|
|
|
./tools/binman/binman -T
|
2018-07-06 16:27:36 +00:00
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
|
|
|
|
./tools/dtoc/dtoc -T
|
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc 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
|