1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-08 07:38:11 +00:00

core/tests: disable fading, improve runners

This commit is contained in:
Jan Pochyla 2019-05-15 08:38:55 +02:00
parent 36534325f0
commit 0b03794fee
2 changed files with 20 additions and 9 deletions

View File

@ -1,18 +1,26 @@
#!/bin/bash #!/bin/bash
MICROPYTHON=../build/unix/micropython SDIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CORE_DIR="$SDIR/.."
MICROPYTHON="$CORE_DIR/build/unix/micropython"
RUN_TEST_EMU=1
DISABLE_FADE=1
PYOPT=0 PYOPT=0
# run emulator # run emulator if RUN_TEST_EMU
cd ../src if [[ $RUN_TEST_EMU > 0 ]]; then
cd "$CORE_DIR/src"
TREZOR_TEST=1 \
TREZOR_DISABLE_FADE=$DISABLE_FADE \
$MICROPYTHON -O$PYOPT main.py >/dev/null & $MICROPYTHON -O$PYOPT main.py >/dev/null &
upy_pid=$! upy_pid=$!
sleep 1 sleep 1
cd -
fi
export TREZOR_PATH=udp:127.0.0.1:21324 export TREZOR_PATH=udp:127.0.0.1:21324
# run tests # run tests
cd ..
error=0 error=0
if ! pytest "$@"; then if ! pytest "$@"; then
error=1 error=1

View File

@ -7,12 +7,15 @@
SDIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" SDIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CORE_DIR="$SDIR/.." CORE_DIR="$SDIR/.."
MICROPYTHON="$CORE_DIR/build/unix/micropython" MICROPYTHON="$CORE_DIR/build/unix/micropython"
DISABLE_FADE=1
PYOPT=0 PYOPT=0
upy_pid="" upy_pid=""
# run emulator if RUN_TEST_EMU # run emulator if RUN_TEST_EMU
if [[ $RUN_TEST_EMU > 0 ]]; then if [[ $RUN_TEST_EMU > 0 ]]; then
cd "$CORE_DIR/src" cd "$CORE_DIR/src"
TREZOR_TEST=1 \
TREZOR_DISABLE_FADE=$DISABLE_FADE \
"$MICROPYTHON" -O$PYOPT main.py >/dev/null & "$MICROPYTHON" -O$PYOPT main.py >/dev/null &
upy_pid=$! upy_pid=$!
cd - cd -