run 1.0 KB
Newer Older
S
Simon Glass 已提交
1 2 3 4 5 6
#!/bin/bash

run_test() {
	$@
	[ $? -ne 0 ] && result=$((result+1))
}
7

8 9
result=0

10
# Run all tests that the standard sandbox build can support
S
Simon Glass 已提交
11
run_test ./test/py/test.py --bd sandbox --build
12 13

# Run tests which require sandbox_spl
S
Simon Glass 已提交
14
run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
15 16 17

# Run tests for the flat DT version of sandbox
./test/py/test.py --bd sandbox_flattree --build
S
Simon Glass 已提交
18

19 20 21
DTC_DIR=build-sandbox_spl/scripts/dtc

PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
S
Simon Glass 已提交
22
	./tools/binman/binman -t
S
Simon Glass 已提交
23
run_test ./tools/patman/patman --test
S
Simon Glass 已提交
24
run_test ./tools/buildman/buildman -t
25
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
S
Simon Glass 已提交
26

S
Simon Glass 已提交
27 28 29 30
# This needs you to set up Python test coverage tools.
# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
#   $ sudo apt-get install python-pip python-pytest
#   $ sudo pip install coverage
31
PYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
S
Simon Glass 已提交
32 33
	./tools/binman/binman -T

S
Simon Glass 已提交
34 35 36 37 38 39
if [ $result == 0 ]; then
	echo "Tests passed!"
else
	echo "Tests FAILED"
	exit 1
fi