core: rename emulator to trezor-emu-core

pull/1153/head
Pavol Rusnak 4 years ago
parent 8502412dbc
commit 063aba910d

@ -67,7 +67,7 @@ core unix regular build:
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
- core/build/unix/micropython - core/build/unix/trezor-emu-core
- core/src/trezor/res/resources.py - core/src/trezor/res/resources.py
expire_in: 1 week expire_in: 1 week
@ -78,7 +78,7 @@ core unix frozen regular build:
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
- core/build/unix/micropython - core/build/unix/trezor-emu-core
expire_in: 1 week expire_in: 1 week
core unix frozen btconly debug build: core unix frozen btconly debug build:
@ -88,11 +88,11 @@ core unix frozen btconly debug build:
BITCOIN_ONLY: "1" BITCOIN_ONLY: "1"
script: script:
- nix-shell --run "pipenv run make -C core build_unix_frozen" - nix-shell --run "pipenv run make -C core build_unix_frozen"
- mv core/build/unix/micropython core/build/unix/micropython-bitcoinonly - mv core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-bitcoinonly
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths: paths:
- core/build/unix/micropython-bitcoinonly - core/build/unix/trezor-emu-core-bitcoinonly
expire_in: 1 week expire_in: 1 week
core unix frozen debug build: core unix frozen debug build:
@ -114,7 +114,7 @@ core unix frozen regular darwin:
script: script:
- nix-shell --run "pipenv run make -C core build_unix_frozen" - nix-shell --run "pipenv run make -C core build_unix_frozen"
- mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs} - mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs}
- cp -v core/build/unix/micropython TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA - cp -v core/build/unix/trezor-emu-core TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
- dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA - dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
- mv TrezorEmu-$CI_COMMIT_SHORT_SHA.app trezor-emu-regular-macos-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.app - mv TrezorEmu-$CI_COMMIT_SHORT_SHA.app trezor-emu-regular-macos-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.app
allow_failure: true allow_failure: true

@ -227,7 +227,7 @@ upgrade tests core deploy:
- "[[ $TAG == '' ]] && echo 'Tag is not core/*: exiting.' && exit 1" - "[[ $TAG == '' ]] && echo 'Tag is not core/*: exiting.' && exit 1"
- DEST=${DEPLOY_PATH}/trezor-emu-$TAG - DEST=${DEPLOY_PATH}/trezor-emu-$TAG
- echo "Deploying to $DEST" - echo "Deploying to $DEST"
- rsync --delete -va core/build/unix/micropython "$DEST" - rsync --delete -va core/build/unix/trezor-emu-core "$DEST"
only: only:
- /^core\// - /^core\//
except: except:

@ -56,7 +56,7 @@ core btconly device test:
dependencies: dependencies:
- core unix frozen btconly debug build - core unix frozen btconly debug build
variables: variables:
MICROPYTHON: "build/unix/micropython-bitcoinonly" MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly"
TREZOR_PYTEST_SKIP_ALTCOINS: 1 TREZOR_PYTEST_SKIP_ALTCOINS: 1
script: script:
- nix-shell --run "pipenv run make -C core test_emu" - nix-shell --run "pipenv run make -C core test_emu"
@ -112,9 +112,9 @@ core fido2 test:
variables: variables:
TREZOR_PROFILING: 1 TREZOR_PROFILING: 1
script: script:
- pgrep micropython || true - pgrep trezor-emu-core || true
- nix-shell --run "pipenv run make -C core test_emu_fido2" - nix-shell --run "pipenv run make -C core test_emu_fido2"
- pgrep micropython || true - pgrep trezor-emu-core || true
- mv core/src/.coverage core/.coverage.test_emu_fido2 - mv core/src/.coverage core/.coverage.test_emu_fido2
artifacts: artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"

@ -67,7 +67,7 @@ res: templates ## update resources
## emulator commands: ## emulator commands:
run: ## run unix port run: ## run unix port
cd src ; ../$(UNIX_BUILD_DIR)/micropython cd src ; ../$(UNIX_BUILD_DIR)/trezor-emu-core
emu: ## run emulator emu: ## run emulator
$(EMU) $(EMU)
@ -139,13 +139,13 @@ build_firmware: res build_cross ## build firmware with frozen modules
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" RDI="$(RDI)" $(FIRMWARE_BUILD_DIR)/firmware.bin $(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" RDI="$(RDI)" $(FIRMWARE_BUILD_DIR)/firmware.bin
build_unix: res ## build unix port build_unix: res ## build unix port
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) BITCOIN_ONLY="$(BITCOIN_ONLY)" $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) BITCOIN_ONLY="$(BITCOIN_ONLY)"
build_unix_frozen: res build_cross ## build unix port with frozen modules build_unix_frozen: res build_cross ## build unix port with frozen modules
$(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_FROZEN=1 $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_FROZEN=1
build_unix_debug: res ## build unix port build_unix_debug: res ## build unix port
$(SCONS) --max-drift=1 CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1 $(SCONS) --max-drift=1 CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1
build_cross: ## build mpy-cross port build_cross: ## build mpy-cross port
$(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS) $(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS)

@ -565,6 +565,6 @@ if EVERYTHING:
env.Depends(obj_program, secp256k1_zkp_ecmult_static_context) env.Depends(obj_program, secp256k1_zkp_ecmult_static_context)
program = env.Command( program = env.Command(
target='micropython', target='trezor-emu-core',
source=obj_program, source=obj_program,
action='$CC -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $LINKFLAGS', ) action='$CC -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $LINKFLAGS', )

@ -22,7 +22,7 @@ except Exception:
HERE = Path(__file__).parent.resolve() HERE = Path(__file__).parent.resolve()
MICROPYTHON = HERE / "build" / "unix" / "micropython" MICROPYTHON = HERE / "build" / "unix" / "trezor-emu-core"
SRC_DIR = HERE / "src" SRC_DIR = HERE / "src"
PROFILING_WRAPPER = HERE / "prof" / "prof.py" PROFILING_WRAPPER = HERE / "prof" / "prof.py"

@ -13,4 +13,4 @@ else
cd "src${TREZOR_MODEL}" cd "src${TREZOR_MODEL}"
fi fi
../build/unix/micropython -O$PYOPT -X heapsize=20M ../build/unix/trezor-emu-core -O$PYOPT -X heapsize=20M

@ -3,7 +3,7 @@
declare -a results declare -a results
declare -i passed=0 failed=0 exit_code=0 declare -i passed=0 failed=0 exit_code=0
declare COLOR_GREEN='\e[32m' COLOR_RED='\e[91m' COLOR_RESET='\e[39m' declare COLOR_GREEN='\e[32m' COLOR_RED='\e[91m' COLOR_RESET='\e[39m'
MICROPYTHON="${MICROPYTHON:-../build/unix/micropython -X heapsize=1M}" MICROPYTHON="${MICROPYTHON:-../build/unix/trezor-emu-core -X heapsize=1M}"
print_summary() { print_summary() {
echo echo

@ -3,7 +3,7 @@
: "${RUN_TEST_EMU:=1}" : "${RUN_TEST_EMU:=1}"
CORE_DIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" CORE_DIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )"
MICROPYTHON="${MICROPYTHON:-$CORE_DIR/build/unix/micropython}" MICROPYTHON="${MICROPYTHON:-$CORE_DIR/build/unix/trezor-emu-core}"
TREZOR_SRC="${CORE_DIR}/src" TREZOR_SRC="${CORE_DIR}/src"
DISABLE_ANIMATION=1 DISABLE_ANIMATION=1

@ -24,7 +24,7 @@ ROOT = Path(__file__).parent.parent.resolve()
BINDIR = ROOT / "tests" / "emulators" BINDIR = ROOT / "tests" / "emulators"
LOCAL_BUILD_PATHS = { LOCAL_BUILD_PATHS = {
"core": ROOT / "core" / "build" / "unix" / "micropython", "core": ROOT / "core" / "build" / "unix" / "trezor-emu-core",
"legacy": ROOT / "legacy" / "firmware" / "trezor.elf", "legacy": ROOT / "legacy" / "firmware" / "trezor.elf",
} }

Loading…
Cancel
Save