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 | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 14 | run_test ./test/py/test.py --bd sandbox_spl --build -k \ |
| 15 | test/py/tests/test_ofplatdata.py |
Simon Glass | e3c1327 | 2017-05-18 20:09:25 -0600 | [diff] [blame] | 16 | |
| 17 | # Run tests for the flat DT version of sandbox |
| 18 | ./test/py/test.py --bd sandbox_flattree --build |
Simon Glass | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 19 | |
Simon Glass | adef03d | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 20 | DTC_DIR=build-sandbox_spl/scripts/dtc |
| 21 | |
| 22 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
Simon Glass | 7465bd2 | 2017-11-26 20:25:56 -0700 | [diff] [blame] | 23 | ./tools/binman/binman -t |
Simon Glass | f972736 | 2017-11-26 20:25:57 -0700 | [diff] [blame] | 24 | run_test ./tools/patman/patman --test |
Simon Glass | e67d60c | 2017-11-26 20:25:58 -0700 | [diff] [blame] | 25 | run_test ./tools/buildman/buildman -t |
Simon Glass | adef03d | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 26 | 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] | 27 | |
Simon Glass | 2605acf | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 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 |
Simon Glass | adef03d | 2017-12-24 12:12:08 -0700 | [diff] [blame] | 32 | PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \ |
Simon Glass | 2605acf | 2017-11-26 20:26:01 -0700 | [diff] [blame] | 33 | ./tools/binman/binman -T |
| 34 | |
Simon Glass | 93c6205 | 2017-11-12 21:52:10 -0700 | [diff] [blame] | 35 | if [ $result == 0 ]; then |
| 36 | echo "Tests passed!" |
| 37 | else |
| 38 | echo "Tests FAILED" |
| 39 | exit 1 |
| 40 | fi |