2019-09-12 13:42:04 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-12-17 16:00:32 +00:00
|
|
|
|
|
|
|
# script/test: Run test suite for application.
|
|
|
|
|
2019-08-22 14:54:10 +00:00
|
|
|
EMULATOR_BINARY="${EMULATOR_BINARY:-firmware/trezor.elf}"
|
|
|
|
|
2017-12-17 16:00:32 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
2017-12-18 21:44:50 +00:00
|
|
|
if [ "$EMULATOR" = 1 ]; then
|
|
|
|
trap "kill %1" EXIT
|
2017-12-17 16:00:32 +00:00
|
|
|
|
2019-08-22 14:54:10 +00:00
|
|
|
"${EMULATOR_BINARY}" &
|
2018-05-11 12:33:31 +00:00
|
|
|
export TREZOR_PATH=udp:127.0.0.1:21324
|
2018-08-14 12:59:31 +00:00
|
|
|
"${PYTHON:-python}" script/wait_for_emulator.py
|
2017-12-17 16:00:32 +00:00
|
|
|
fi
|
|
|
|
|
2020-01-02 17:55:37 +00:00
|
|
|
"${PYTHON:-python}" -m pytest --junitxml=../tests/junit.xml ../tests/device_tests "$@"
|