summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-21 13:14:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-23 14:29:00 +0000
commitac82dc43b8151ed34c4ad51e9ab7f4a612990486 (patch)
treea09d97a87bdc46247dd0074dee009490b6042cfb /meta/lib/oeqa
parent4c45f975310184a773b25b8e7d7ef50fba2f7bd6 (diff)
downloadopenembedded-core-ac82dc43b8151ed34c4ad51e9ab7f4a612990486.tar.gz
oeqa/selftest/rust: Simplify the rust testsuite output gathering/processing
The rust testsuite was redirecting command output to a file, which made it hard to debug failure cases since the logs were not available to print to the console. Rework the code so it uses the existing popen logging and hence allows us to improve the error logging situation and make debugging failures easier. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/cases/rust.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 120be6454f..ad14189c6d 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -216,13 +216,16 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
# Trigger testing.
cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
- cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s > summary.txt 2>&1;" % (builddir, testargs, targetsys)
- runCmd(cmd)
+ cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys)
+ retval = runCmd(cmd)
end_time = time.time()
+ resultlog = rustlibpath + "/results-log.txt"
+ with open(resultlog, "w") as f:
+ f.write(retval.output)
+
ptestsuite = "rust"
- self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = builddir + "/summary.txt")
- filename = builddir + "/summary.txt"
- test_results = parse_results(filename)
+ self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile=resultlog)
+ test_results = parse_results(resultlog)
for test in test_results:
self.ptest_result(ptestsuite, test, test_results[test])