Simon Glass | 2f52018 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | run_test() { |
| 4 | $@ |
| 5 | [ $? -ne 0 ] && result=$((result+1)) |
Simon Glass | 2f52018 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 6 | } |
Simon Glass | 07f4ead | 2016-07-03 09:40:34 -0600 | [diff] [blame] | 7 | |
Simon Glass | 73a01d9 | 2017-11-26 20:25:55 -0700 | [diff] [blame] | 8 | result=0 |
| 9 | |
Simon Glass | 029ab15 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 10 | # Run all tests that the standard sandbox build can support |
Simon Glass | 2f52018 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 11 | run_test ./test/py/test.py --bd sandbox --build |
Simon Glass | 029ab15 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 12 | |
| 13 | # Run tests which require sandbox_spl |
Simon Glass | bf6226c | 2018-05-16 01:10:24 -0600 | [diff] [blame] | 14 | run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py |
Simon Glass | 029ab15 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 15 | |
| 16 | # Run tests for the flat DT version of sandbox |
| 17 | ./test/py/test.py --bd sandbox_flattree --build |
Simon Glass | 2f52018 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 18 | |
Simon Glass | ed772fe | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 19 | DTC_DIR=build-sandbox_spl/scripts/dtc |
| 20 | |
| 21 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
Simon Glass | 72d8172 | 2017-11-26 20:25:56 -0700 | [diff] [blame] | 22 | ./tools/binman/binman -t |
Simon Glass | adb5b61 | 2017-11-26 20:25:57 -0700 | [diff] [blame] | 23 | run_test ./tools/patman/patman --test |
Simon Glass | 34ba7d7 | 2017-11-26 20:25:58 -0700 | [diff] [blame] | 24 | run_test ./tools/buildman/buildman -t |
Simon Glass | ed772fe | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 25 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t |
Simon Glass | 72d8172 | 2017-11-26 20:25:56 -0700 | [diff] [blame] | 26 | |
Simon Glass | 30d704c | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 27 | # This needs you to set up Python test coverage tools. |
| 28 | # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu): |
Tom Rini | 16d836c | 2018-07-06 10:27:14 -0600 | [diff] [blame] | 29 | # $ sudo apt-get install python-pytest python-coverage |
Simon Glass | ed772fe | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 30 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
Simon Glass | 30d704c | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 31 | ./tools/binman/binman -T |
Simon Glass | ef6f77a | 2018-07-06 10:27:36 -0600 | [diff] [blame^] | 32 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
| 33 | ./tools/dtoc/dtoc -T |
| 34 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
| 35 | ./tools/dtoc/test_fdt -T |
Simon Glass | 30d704c | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 36 | |
Simon Glass | 2f52018 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 37 | if [ $result == 0 ]; then |
| 38 | echo "Tests passed!" |
| 39 | else |
| 40 | echo "Tests FAILED" |
| 41 | exit 1 |
| 42 | fi |