blob: 6b73813f9bc62732d672cef73d7756f7730aeb44 [file] [log] [blame]
Simon Glass93c62052017-11-12 21:52:10 -07001#!/bin/bash
2
3run_test() {
4 $@
5 [ $? -ne 0 ] && result=$((result+1))
Simon Glass93c62052017-11-12 21:52:10 -07006}
Simon Glass8ab6cc32016-07-03 09:40:34 -06007
Simon Glass2c0f8152017-11-26 20:25:55 -07008result=0
9
Simon Glasse3c13272017-05-18 20:09:25 -060010# Run all tests that the standard sandbox build can support
Simon Glass93c62052017-11-12 21:52:10 -070011run_test ./test/py/test.py --bd sandbox --build
Simon Glasse3c13272017-05-18 20:09:25 -060012
13# Run tests which require sandbox_spl
Simon Glass8fd53ca2018-05-16 01:10:24 -060014run_test ./test/py/test.py --bd sandbox_spl --build -k test_ofplatdata.py
Simon Glasse3c13272017-05-18 20:09:25 -060015
16# Run tests for the flat DT version of sandbox
17./test/py/test.py --bd sandbox_flattree --build
Simon Glass93c62052017-11-12 21:52:10 -070018
Simon Glass1935c4e2018-10-01 21:12:37 -060019# 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.
Simon Glassadef03d2017-12-24 12:12:08 -070021DTC_DIR=build-sandbox_spl/scripts/dtc
Simon Glass1935c4e2018-10-01 21:12:37 -060022export PYTHONPATH=${DTC_DIR}/pylibfdt
23export DTC=${DTC_DIR}/dtc
Simon Glassadef03d2017-12-24 12:12:08 -070024
Simon Glass1935c4e2018-10-01 21:12:37 -060025run_test ./tools/binman/binman -t
Simon Glassf9727362017-11-26 20:25:57 -070026run_test ./tools/patman/patman --test
Simon Glasse67d60c2017-11-26 20:25:58 -070027run_test ./tools/buildman/buildman -t
Simon Glass1935c4e2018-10-01 21:12:37 -060028run_test ./tools/dtoc/dtoc -t
Simon Glass7465bd22017-11-26 20:25:56 -070029
Simon Glass2605acf2017-11-26 20:26:01 -070030# This needs you to set up Python test coverage tools.
31# To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
Tom Rinic2a849d2018-07-06 10:27:14 -060032# $ sudo apt-get install python-pytest python-coverage
Simon Glass1935c4e2018-10-01 21:12:37 -060033run_test ./tools/binman/binman -T
34run_test ./tools/dtoc/dtoc -T
35run_test ./tools/dtoc/test_fdt -T
Simon Glass2605acf2017-11-26 20:26:01 -070036
Simon Glass93c62052017-11-12 21:52:10 -070037if [ $result == 0 ]; then
38 echo "Tests passed!"
39else
40 echo "Tests FAILED"
41 exit 1
42fi