Simon Glass | 93c6205 | 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 | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 6 | } |
Simon Glass | 8ab6cc3 | 2016-07-03 09:40:34 -0600 | [diff] [blame] | 7 | |
Simon Glass | 2c0f815 | 2017-11-26 20:25:55 -0700 | [diff] [blame] | 8 | result=0 |
| 9 | |
Simon Glass | e3c1327 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 10 | # Run all tests that the standard sandbox build can support |
Simon Glass | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 11 | run_test ./test/py/test.py --bd sandbox --build |
Simon Glass | e3c1327 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 12 | |
| 13 | # Run tests which require sandbox_spl |
Simon Glass | 8fd53ca | 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 | e3c1327 | 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 | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 18 | |
Simon Glass | adef03d | 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 | 7465bd2 | 2017-11-26 20:25:56 -0700 | [diff] [blame] | 22 | ./tools/binman/binman -t |
Simon Glass | f972736 | 2017-11-26 20:25:57 -0700 | [diff] [blame] | 23 | run_test ./tools/patman/patman --test |
Simon Glass | e67d60c | 2017-11-26 20:25:58 -0700 | [diff] [blame] | 24 | run_test ./tools/buildman/buildman -t |
Simon Glass | adef03d | 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 | 7465bd2 | 2017-11-26 20:25:56 -0700 | [diff] [blame] | 26 | |
Simon Glass | 2605acf | 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 | c2a849d | 2018-07-06 10:27:14 -0600 | [diff] [blame] | 29 | # $ sudo apt-get install python-pytest python-coverage |
Simon Glass | adef03d | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 30 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
Simon Glass | 2605acf | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 31 | ./tools/binman/binman -T |
Simon Glass | 6d52052 | 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 | 2605acf | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 36 | |
Simon Glass | 93c6205 | 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 |