xref: /openbmc/u-boot/test/run (revision 16d836cd6fa0d22e24fa2340df08e6d6d80c5107)
12f52018cSSimon Glass#!/bin/bash
22f52018cSSimon Glass
32f52018cSSimon Glassrun_test() {
42f52018cSSimon Glass	$@
52f52018cSSimon Glass	[ $? -ne 0 ] && result=$((result+1))
62f52018cSSimon Glass}
707f4eadcSSimon Glass
873a01d90SSimon Glassresult=0
973a01d90SSimon Glass
10029ab15aSSimon Glass# Run all tests that the standard sandbox build can support
112f52018cSSimon Glassrun_test ./test/py/test.py --bd sandbox --build
12029ab15aSSimon Glass
13029ab15aSSimon Glass# Run tests which require sandbox_spl
14bf6226c3SSimon Glassrun_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
15029ab15aSSimon Glass
16029ab15aSSimon Glass# Run tests for the flat DT version of sandbox
17029ab15aSSimon Glass./test/py/test.py --bd sandbox_flattree --build
182f52018cSSimon Glass
19ed772fe7SSimon GlassDTC_DIR=build-sandbox_spl/scripts/dtc
20ed772fe7SSimon Glass
21ed772fe7SSimon GlassPYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
2272d8172bSSimon Glass	./tools/binman/binman -t
23adb5b616SSimon Glassrun_test ./tools/patman/patman --test
2434ba7d77SSimon Glassrun_test ./tools/buildman/buildman -t
25ed772fe7SSimon GlassPYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test ./tools/dtoc/dtoc -t
2672d8172bSSimon Glass
2730d704c6SSimon Glass# This needs you to set up Python test coverage tools.
2830d704c6SSimon Glass# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
29*16d836cdSTom Rini#   $ sudo apt-get install python-pytest python-coverage
30ed772fe7SSimon GlassPYTHONPATH=${DTC_DIR}/pylibfdt DTC=${DTC_DIR}/dtc run_test \
3130d704c6SSimon Glass	./tools/binman/binman -T
3230d704c6SSimon Glass
332f52018cSSimon Glassif [ $result == 0 ]; then
342f52018cSSimon Glass	echo "Tests passed!"
352f52018cSSimon Glasselse
362f52018cSSimon Glass	echo "Tests FAILED"
372f52018cSSimon Glass	exit 1
382f52018cSSimon Glassfi
39