xref: /openbmc/u-boot/test/run (revision 734f3de9242040d27b7e40ae7f3d980192af5417)
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
19*734f3de9SSimon Glass# Set up a path to dtc (device-tree compiler) and libfdt.py, a library it
20*734f3de9SSimon Glass# provides and which is built by the sandbox_spl config.
21ed772fe7SSimon GlassDTC_DIR=build-sandbox_spl/scripts/dtc
22*734f3de9SSimon Glassexport PYTHONPATH=${DTC_DIR}/pylibfdt
23*734f3de9SSimon Glassexport DTC=${DTC_DIR}/dtc
24ed772fe7SSimon Glass
25*734f3de9SSimon Glassrun_test ./tools/binman/binman -t
26adb5b616SSimon Glassrun_test ./tools/patman/patman --test
2734ba7d77SSimon Glassrun_test ./tools/buildman/buildman -t
28*734f3de9SSimon Glassrun_test ./tools/dtoc/dtoc -t
2972d8172bSSimon Glass
3030d704c6SSimon Glass# This needs you to set up Python test coverage tools.
3130d704c6SSimon Glass# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
3216d836cdSTom Rini#   $ sudo apt-get install python-pytest python-coverage
33*734f3de9SSimon Glassrun_test ./tools/binman/binman -T
34*734f3de9SSimon Glassrun_test ./tools/dtoc/dtoc -T
35*734f3de9SSimon Glassrun_test ./tools/dtoc/test_fdt -T
3630d704c6SSimon Glass
372f52018cSSimon Glassif [ $result == 0 ]; then
382f52018cSSimon Glass	echo "Tests passed!"
392f52018cSSimon Glasselse
402f52018cSSimon Glass	echo "Tests FAILED"
412f52018cSSimon Glass	exit 1
422f52018cSSimon Glassfi
43