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