1#!/bin/bash 2 3run_test() { 4 $@ 5 [ $? -ne 0 ] && result=$((result+1)) 6} 7 8result=0 9 10# Run all tests that the standard sandbox build can support 11run_test ./test/py/test.py --bd sandbox --build 12 13# Run tests which require sandbox_spl 14run_test ./test/py/test.py --bd sandbox_spl --build -k \ 15 test/py/tests/test_ofplatdata.py 16 17# Run tests for the flat DT version of sandbox 18./test/py/test.py --bd sandbox_flattree --build 19 20PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ 21 ./tools/binman/binman -t 22run_test ./tools/patman/patman --test 23run_test ./tools/buildman/buildman -t 24PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test ./tools/dtoc/dtoc -t 25 26# This needs you to set up Python test coverage tools. 27# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): 28# $ sudo apt-get install python-pip python-pytest 29# $ sudo pip install coverage 30PYTHONPATH=build-sandbox_spl/scripts/dtc/pylibfdt run_test \ 31 ./tools/binman/binman -T 32 33if [ $result == 0 ]; then 34 echo "Tests passed!" 35else 36 echo "Tests FAILED" 37 exit 1 38fi 39