summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/rust.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-19 11:23:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-07-19 18:00:32 +0100
commit07a65a3decc610b485e3eb7f36f8014f74d0f92a (patch)
tree16e214668e2fdb3b884495059540b8abe51e1c69 /meta/lib/oeqa/selftest/cases/rust.py
parenta1096d4a57942e1b57bdd0884b363a028ac479d5 (diff)
downloadpoky-07a65a3decc610b485e3eb7f36f8014f74d0f92a.tar.gz
oeqa/selftest/rust: Various fixes to work correctly
* Ensure the test/class naming doesn't allow the to be triggered without the toolchain decorator * Add the toolchain-user decorator so it runs on non-IA targets * Strip the leading "[XX] " prefix from the test names * Ensure skipped test counts are passed through correctly (as SKIPPED, not SKIP) * Avoid duplicate test results and show a warning if any are found (duplicates were from other sources in the end but the code remains sensible to have) (From OE-Core rev: b1718ce5b2b2db35a8e1c88087deee41f99094b4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/rust.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/rust.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 4fbe8f08fa..7a0fd7033d 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -8,23 +8,34 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqem
8from oeqa.utils.sshcontrol import SSHControl 8from oeqa.utils.sshcontrol import SSHControl
9 9
10def parse_results(filename): 10def parse_results(filename):
11 tests = [] 11 tests = {}
12 with open(filename, "r") as f: 12 with open(filename, "r") as f:
13 lines = f.readlines() 13 lines = f.readlines()
14 for line in lines: 14 for line in lines:
15 if "..." in line and "test [" in line: 15 if "..." in line and "test [" in line:
16 test = line.split("test ")[1].split(" ... ")[0] 16 test = line.split("test ")[1].split(" ... ")[0]
17 if "] " in test:
18 test = test.split("] ", 1)[1]
17 result = line.split(" ... ")[1].strip() 19 result = line.split(" ... ")[1].strip()
18 if result == "ok": 20 if result == "ok":
19 result = "PASS" 21 result = "PASS"
20 elif result == "failed": 22 elif result == "failed":
21 result = "FAIL" 23 result = "FAIL"
22 elif "ignored" in result: 24 elif "ignored" in result:
23 result = "SKIP" 25 result = "SKIPPED"
24 tests.append((test, result)) 26 if test in tests:
27 if tests[test] != result:
28 print("Duplicate and mismatching result %s for %s" % (result, test))
29 else:
30 print("Duplicate result %s for %s" % (result, test))
31 else:
32 tests[test] = result
25 return tests 33 return tests
26 34
27# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set to 40 number of jobs. 35# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set to 40 number of jobs.
36@OETestTag("toolchain-system")
37@OETestTag("toolchain-user")
38@OETestTag("runqemu")
28class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): 39class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
29 def test_rust(self, *args, **kwargs): 40 def test_rust(self, *args, **kwargs):
30 # build remote-test-server before image build 41 # build remote-test-server before image build
@@ -75,11 +86,5 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
75 self.ptest_section(ptestsuite, logfile = builddir + "/summary.txt") 86 self.ptest_section(ptestsuite, logfile = builddir + "/summary.txt")
76 filename = builddir + "/summary.txt" 87 filename = builddir + "/summary.txt"
77 test_results = parse_results(filename) 88 test_results = parse_results(filename)
78 for test, result in test_results: 89 for test in test_results:
79 self.ptest_result(ptestsuite, test, result) 90 self.ptest_result(ptestsuite, test, test_results[test])
80
81@OETestTag("toolchain-system")
82@OETestTag("runqemu")
83class RustSelfTestBase(RustSelfTestSystemEmulated):
84 def test_check(self):
85 self.test_rust()