run 1.1 KB

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