run 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 test_ofplatdata.py
  11. # Run tests for the flat DT version of sandbox
  12. ./test/py/test.py --bd sandbox_flattree --build
  13. DTC_DIR=build-sandbox_spl/scripts/dtc
  14. PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
  15. ./tools/binman/binman -t
  16. run_test ./tools/patman/patman --test
  17. run_test ./tools/buildman/buildman -t
  18. PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
  19. # This needs you to set up Python test coverage tools.
  20. # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
  21. # $ sudo apt-get install python-pytest python-coverage
  22. PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
  23. ./tools/binman/binman -T
  24. PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
  25. ./tools/dtoc/dtoc -T
  26. PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
  27. ./tools/dtoc/test_fdt -T
  28. if [ $result == 0 ]; then
  29. echo "Tests passed!"
  30. else
  31. echo "Tests FAILED"
  32. exit 1
  33. fi