2019-10-21 14:49:34 +00:00
|
|
|
import os
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2020-01-23 17:41:25 +00:00
|
|
|
from ..emulators import LOCAL_BUILD_PATHS
|
2019-10-21 14:49:34 +00:00
|
|
|
|
|
|
|
SELECTED_GENS = [
|
|
|
|
gen.strip() for gen in os.environ.get("TREZOR_UPGRADE_TEST", "").split(",") if gen
|
|
|
|
]
|
|
|
|
|
|
|
|
if SELECTED_GENS:
|
|
|
|
# if any gens were selected via the environment variable, force enable all selected
|
|
|
|
LEGACY_ENABLED = "legacy" in SELECTED_GENS
|
|
|
|
CORE_ENABLED = "core" in SELECTED_GENS
|
|
|
|
|
|
|
|
else:
|
|
|
|
# if no selection was provided, select those for which we have emulators
|
2020-01-23 17:41:25 +00:00
|
|
|
LEGACY_ENABLED = LOCAL_BUILD_PATHS["legacy"].exists()
|
|
|
|
CORE_ENABLED = LOCAL_BUILD_PATHS["core"].exists()
|
2019-10-21 14:49:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
legacy_only = pytest.mark.skipif(
|
|
|
|
not LEGACY_ENABLED, reason="This test requires legacy emulator"
|
|
|
|
)
|
|
|
|
|
|
|
|
core_only = pytest.mark.skipif(
|
|
|
|
not CORE_ENABLED, reason="This test requires core emulator"
|
|
|
|
)
|