6b73813f9bc62732d672cef73d7756f7730aeb44
[oweals/u-boot.git] / test / run
1 #!/bin/bash
2
3 run_test() {
4         $@
5         [ $? -ne 0 ] && result=$((result+1))
6 }
7
8 result=0
9
10 # Run all tests that the standard sandbox build can support
11 run_test ./test/py/test.py --bd sandbox --build
12
13 # Run tests which require sandbox_spl
14 run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
15
16 # Run tests for the flat DT version of sandbox
17 ./test/py/test.py --bd sandbox_flattree --build
18
19 # Set up a path to dtc (device-tree compiler) and libfdt.py, a library it
20 # provides and which is built by the sandbox_spl config.
21 DTC_DIR=build-sandbox_spl/scripts/dtc
22 export PYTHONPATH=${DTC_DIR}/pylibfdt
23 export DTC=${DTC_DIR}/dtc
24
25 run_test ./tools/binman/binman -t
26 run_test ./tools/patman/patman --test
27 run_test ./tools/buildman/buildman -t
28 run_test ./tools/dtoc/dtoc -t
29
30 # This needs you to set up Python test coverage tools.
31 # To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
32 #   $ sudo apt-get install python-pytest python-coverage
33 run_test ./tools/binman/binman -T
34 run_test ./tools/dtoc/dtoc -T
35 run_test ./tools/dtoc/test_fdt -T
36
37 if [ $result == 0 ]; then
38         echo "Tests passed!"
39 else
40         echo "Tests FAILED"
41         exit 1
42 fi