Skip to content

Commit 90ac2ac

Browse files
committed
tests: enable coverage on aarch64
Fixes #1579. Signed-off-by: Diana Popa <[email protected]>
1 parent 1dcc8e0 commit 90ac2ac

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

tests/host_tools/proc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,9 @@ def proc_type():
1313
for line in lines:
1414
if "model name" in line:
1515
return re.sub(".*model name.*:", "", line, 1)
16+
17+
cmd = "uname -m"
18+
result = utils.run_cmd(cmd).stdout.strip()
19+
if "aarch64" in result:
20+
return "ARM"
1621
return ""

tests/integration_tests/build/test_coverage.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# this contains the frequency while on AMD it does not.
2424
# Checkout the cpuid crate. In the future other
2525
# differences may appear.
26-
COVERAGE_DICT = {"Intel": 84.5, "AMD": 84.52}
26+
COVERAGE_DICT = {"Intel": 84.5, "AMD": 84.52, "ARM": 82}
2727
PROC_MODEL = proc.proc_type()
2828

2929
COVERAGE_MAX_DELTA = 0.05
@@ -78,10 +78,6 @@ def test_ensure_mod_tests():
7878

7979

8080
@pytest.mark.timeout(400)
81-
@pytest.mark.skipif(
82-
platform.machine() != "x86_64",
83-
reason="kcov hangs on aarch64"
84-
)
8581
def test_coverage(test_session_root_path, test_session_tmp_path):
8682
"""Test line coverage with kcov.
8783
@@ -105,14 +101,17 @@ def test_coverage(test_session_root_path, test_session_tmp_path):
105101
'_gen'
106102
)
107103
exclude_region = '\'mod tests {\''
104+
target = "{}-unknown-linux-musl".format(platform.machine())
108105

109106
cmd = (
110-
'CARGO_TARGET_DIR={} cargo kcov --all '
111-
'--output {} -- '
107+
'RUSTFLAGS="{}" CARGO_TARGET_DIR={} cargo kcov --all '
108+
'--target {} --output {} -- '
112109
'--exclude-pattern={} '
113110
'--exclude-region={} --verify'
114111
).format(
112+
host.get_rustflags(),
115113
os.path.join(test_session_root_path, CARGO_KCOV_REL_PATH),
114+
target,
116115
test_session_tmp_path,
117116
exclude_pattern,
118117
exclude_region

0 commit comments

Comments
 (0)