xref: /openbmc/u-boot/test/run (revision 7da7ff54)
1#!/bin/bash
2
3run_test() {
4	$@
5	[ $? -ne 0 ] && result=$((result+1))
6}
7
8result=0
9
10# Run all tests that the standard sandbox build can support
11run_test ./test/py/test.py --bd sandbox --build
12
13# Run tests which require sandbox_spl
14run_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
19DTC_DIR=build-sandbox_spl/scripts/dtc
20
21PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
22	./tools/binman/binman -t
23run_test ./tools/patman/patman --test
24run_test ./tools/buildman/buildman -t
25PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
26
27# This needs you to set up Python test coverage tools.
28# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
29#   $ sudo apt-get install python-pip python-pytest
30#   $ sudo pip install coverage
31PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
32	./tools/binman/binman -T
33
34if [ $result == 0 ]; then
35	echo "Tests passed!"
36else
37	echo "Tests FAILED"
38	exit 1
39fi
40