blob: d77a1c371b44bbc3a15c890c33c274374b77b961 [file] [log] [blame]
Simon Glass2f520182017-11-12 21:52:10 -07001#!/bin/bash
2
3run_test() {
4 $@
5 [ $? -ne 0 ] && result=$((result+1))
Simon Glass2f520182017-11-12 21:52:10 -07006}
Simon Glass07f4ead2016-07-03 09:40:34 -06007
Simon Glass73a01d92017-11-26 20:25:55 -07008result=0
9
Simon Glass029ab152017-05-18 20:09:25 -060010# Run all tests that the standard sandbox build can support
Simon Glass2f520182017-11-12 21:52:10 -070011run_test ./test/py/test.py --bd sandbox --build
Simon Glass029ab152017-05-18 20:09:25 -060012
13# Run tests which require sandbox_spl
Simon Glassbf6226c2018-05-16 01:10:24 -060014run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
Simon Glass029ab152017-05-18 20:09:25 -060015
16# Run tests for the flat DT version of sandbox
17./test/py/test.py --bd sandbox_flattree --build
Simon Glass2f520182017-11-12 21:52:10 -070018
Simon Glassed772fe2017-12-24 12:12:08 -070019DTC_DIR=build-sandbox_spl/scripts/dtc
20
21PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
Simon Glass72d81722017-11-26 20:25:56 -070022 ./tools/binman/binman -t
Simon Glassadb5b612017-11-26 20:25:57 -070023run_test ./tools/patman/patman --test
Simon Glass34ba7d72017-11-26 20:25:58 -070024run_test ./tools/buildman/buildman -t
Simon Glassed772fe2017-12-24 12:12:08 -070025PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
Simon Glass72d81722017-11-26 20:25:56 -070026
Simon Glass30d704c2017-11-26 20:26:01 -070027# This needs you to set up Python test coverage tools.
28# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
Tom Rini16d836c2018-07-06 10:27:14 -060029# $ sudo apt-get install python-pytest python-coverage
Simon Glassed772fe2017-12-24 12:12:08 -070030PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
Simon Glass30d704c2017-11-26 20:26:01 -070031 ./tools/binman/binman -T
Simon Glassef6f77a2018-07-06 10:27:36 -060032PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
33 ./tools/dtoc/dtoc -T
34PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
35 ./tools/dtoc/test_fdt -T
Simon Glass30d704c2017-11-26 20:26:01 -070036
Simon Glass2f520182017-11-12 21:52:10 -070037if [ $result == 0 ]; then
38 echo "Tests passed!"
39else
40 echo "Tests FAILED"
41 exit 1
42fi