2017-12-17 16:00:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# script/test: Run test suite for application.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2017-12-18 20:38:31 +00:00
|
|
|
if [ \! -d device_tests ]; then
|
|
|
|
curl -s -L https://github.com/trezor/python-trezor/archive/master.tar.gz | tar -xvz --strip-components=2 python-trezor-master/tests/device_tests
|
|
|
|
fi
|
|
|
|
|
2017-12-17 16:00:32 +00:00
|
|
|
# Kill jobs on exit
|
|
|
|
trap "exit" INT TERM
|
|
|
|
trap "kill 0" EXIT
|
|
|
|
|
2017-12-17 18:26:00 +00:00
|
|
|
if [ "$EMULATOR" = 1 ] && [ -z "$(pidof trezor.elf)" ]; then
|
2017-12-17 16:00:32 +00:00
|
|
|
firmware/trezor.elf &
|
|
|
|
fi
|
|
|
|
|
2017-12-18 20:38:31 +00:00
|
|
|
TREZOR_TRANSPORT_V1=1 pytest "device_tests" &
|
2017-12-17 16:00:32 +00:00
|
|
|
|
|
|
|
# Wait for either job to exit and kill the other
|
|
|
|
wait -n
|