tests/run-tests.py: Detect target sys.implementation._build if possible.

That's useful to know the exact board that's being tested.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-08-18 21:27:49 +10:00
parent bfda577a3e
commit 4a60d230c3
2 changed files with 4 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ arch = [
"xtensawin",
"rv32imc",
][sys_mpy >> 10]
build = getattr(sys.implementation, "_build", "unknown")
thread = getattr(sys.implementation, "_thread", None)
# Detect how many bits of precision the floating point implementation has.
@@ -33,4 +34,4 @@ try:
except NameError:
float_prec = 0
print(platform, arch, thread, float_prec, len("α") == 1)
print(platform, arch, build, thread, float_prec, len("α") == 1)

View File

@@ -291,7 +291,7 @@ def detect_test_platform(pyb, args):
output = run_feature_check(pyb, args, "target_info.py")
if output.endswith(b"CRASH"):
raise ValueError("cannot detect platform: {}".format(output))
platform, arch, thread, float_prec, unicode = str(output, "ascii").strip().split()
platform, arch, build, thread, float_prec, unicode = str(output, "ascii").strip().split()
if arch == "None":
arch = None
inlineasm_arch = detect_inline_asm_arch(pyb, args)
@@ -305,6 +305,7 @@ def detect_test_platform(pyb, args):
if arch and not args.mpy_cross_flags:
args.mpy_cross_flags = "-march=" + arch
args.inlineasm_arch = inlineasm_arch
args.build = build
args.thread = thread
args.float_prec = float_prec
args.unicode = unicode