mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-17 01:52:02 +00:00
core/prof: make sure coverage data is generated with absolute paths
This commit is contained in:
parent
34332cc294
commit
a3d309eca2
@ -217,6 +217,7 @@ def cli(
|
|||||||
TREZOR_PROFILE_DIR=str(profile_dir.resolve()),
|
TREZOR_PROFILE_DIR=str(profile_dir.resolve()),
|
||||||
TREZOR_UDP_PORT=str(emulator.port),
|
TREZOR_UDP_PORT=str(emulator.port),
|
||||||
TREZOR_FIDO2_UDP_PORT=str(emulator.port + 2),
|
TREZOR_FIDO2_UDP_PORT=str(emulator.port + 2),
|
||||||
|
TREZOR_SRC=str(SRC_DIR),
|
||||||
)
|
)
|
||||||
os.environ.update(emulator_env)
|
os.environ.update(emulator_env)
|
||||||
for k, v in emulator_env.items():
|
for k, v in emulator_env.items():
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from uio import open
|
from uio import open
|
||||||
|
from uos import getenv
|
||||||
|
|
||||||
# We need to insert "" to sys.path so that the frozen build can import main from the
|
# We need to insert "" to sys.path so that the frozen build can import main from the
|
||||||
# frozen modules, and regular build can import it from current directory.
|
# frozen modules, and regular build can import it from current directory.
|
||||||
sys.path.insert(0, "")
|
sys.path.insert(0, "")
|
||||||
|
|
||||||
|
PATH_PREFIX = (getenv("TREZOR_SRC") or ".") + "/"
|
||||||
|
|
||||||
|
|
||||||
class Coverage:
|
class Coverage:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -22,7 +25,7 @@ class Coverage:
|
|||||||
this_file = globals()["__file__"]
|
this_file = globals()["__file__"]
|
||||||
for filename in self.__files:
|
for filename in self.__files:
|
||||||
if not filename == this_file:
|
if not filename == this_file:
|
||||||
lines[filename] = list(self.__files[filename])
|
lines[PATH_PREFIX + filename] = list(self.__files[filename])
|
||||||
|
|
||||||
return lines_execution
|
return lines_execution
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user