2017-11-12 21:52:10 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
run_test() {
|
|
|
|
$@
|
|
|
|
[ $? -ne 0 ] && result=$((result+1))
|
|
|
|
}
|
2016-07-03 09:40:34 -06:00
|
|
|
|
2017-11-26 20:25:55 -07:00
|
|
|
result=0
|
|
|
|
|
2017-05-18 20:09:25 -06:00
|
|
|
# Run all tests that the standard sandbox build can support
|
2017-11-12 21:52:10 -07:00
|
|
|
run_test ./test/py/test.py --bd sandbox --build
|
2017-05-18 20:09:25 -06:00
|
|
|
|
|
|
|
# Run tests which require sandbox_spl
|
2017-11-12 21:52:10 -07:00
|
|
|
run_test ./test/py/test.py --bd sandbox_spl --build -k \
|
|
|
|
test/py/tests/test_ofplatdata.py
|
2017-05-18 20:09:25 -06:00
|
|
|
|
|
|
|
# Run tests for the flat DT version of sandbox
|
|
|
|
./test/py/test.py --bd sandbox_flattree --build
|
2017-11-12 21:52:10 -07:00
|
|
|
|
2017-12-24 12:12:08 -07:00
|
|
|
DTC_DIR=build-sandbox_spl/scripts/dtc
|
|
|
|
|
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
|
2017-11-26 20:25:56 -07:00
|
|
|
./tools/binman/binman -t
|
2017-11-26 20:25:57 -07:00
|
|
|
run_test ./tools/patman/patman --test
|
2017-11-26 20:25:58 -07:00
|
|
|
run_test ./tools/buildman/buildman -t
|
2017-12-24 12:12:08 -07:00
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
|
2017-11-26 20:25:56 -07:00
|
|
|
|
2017-11-26 20:26:01 -07:00
|
|
|
# This needs you to set up Python test coverage tools.
|
|
|
|
# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
|
|
|
|
# $ sudo apt-get install python-pip python-pytest
|
|
|
|
# $ sudo pip install coverage
|
2017-12-24 12:12:08 -07:00
|
|
|
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
|
2017-11-26 20:26:01 -07:00
|
|
|
./tools/binman/binman -T
|
|
|
|
|
2017-11-12 21:52:10 -07:00
|
|
|
if [ $result == 0 ]; then
|
|
|
|
echo "Tests passed!"
|
|
|
|
else
|
|
|
|
echo "Tests FAILED"
|
|
|
|
exit 1
|
|
|
|
fi
|