summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/gcc.py
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-09-11 14:13:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-16 23:02:43 +0100
commit6c7d657aaeb223c3136e916da34468af468397b7 (patch)
tree8d9657740e0b70d18f845052f5bbb65ad96f51f5 /meta/lib/oeqa/selftest/cases/gcc.py
parente08f657220fa119793949e26b2837026956d4238 (diff)
downloadpoky-6c7d657aaeb223c3136e916da34468af468397b7.tar.gz
oeqa/selftest: Rework toolchain tests to use OEPTestResultTestCase
Use OEPTestResultTestCase to collect results and add logfile collection and compression. (From OE-Core rev: b75aced558013a459f29617b53cf477cb9b387ac) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/gcc.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/gcc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py
index 2c25b5904c..5a917b9c44 100644
--- a/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/meta/lib/oeqa/selftest/cases/gcc.py
@@ -1,6 +1,7 @@
1# SPDX-License-Identifier: MIT 1# SPDX-License-Identifier: MIT
2import os 2import os
3from oeqa.core.decorator import OETestTag 3from oeqa.core.decorator import OETestTag
4from oeqa.core.case import OEPTestResultTestCase
4from oeqa.selftest.case import OESelftestTestCase 5from oeqa.selftest.case import OESelftestTestCase
5from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command 6from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
6 7
@@ -11,7 +12,7 @@ def parse_values(content):
11 yield i[len(v) + 2:].strip(), v 12 yield i[len(v) + 2:].strip(), v
12 break 13 break
13 14
14class GccSelfTestBase(OESelftestTestCase): 15class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
15 def check_skip(self, suite): 16 def check_skip(self, suite):
16 targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split() 17 targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split()
17 if suite not in targets: 18 if suite not in targets:
@@ -41,20 +42,20 @@ class GccSelfTestBase(OESelftestTestCase):
41 bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) 42 bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe)
42 builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] 43 builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"]
43 44
44 self.extraresults = {"ptestresult.sections" : {}}
45 for suite in suites: 45 for suite in suites:
46 sumspath = os.path.join(builddir, "gcc", "testsuite", suite, "{0}.sum".format(suite)) 46 sumspath = os.path.join(builddir, "gcc", "testsuite", suite, "{0}.sum".format(suite))
47 if not os.path.exists(sumspath): # check in target dirs 47 if not os.path.exists(sumspath): # check in target dirs
48 sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite)) 48 sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite))
49 if not os.path.exists(sumspath): # handle libstdc++-v3 -> libstdc++ 49 if not os.path.exists(sumspath): # handle libstdc++-v3 -> libstdc++
50 sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite.split("-")[0])) 50 sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite.split("-")[0]))
51 logpath = os.path.splitext(sumspath)[0] + ".log"
51 52
52 ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite 53 ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite
53 ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite 54 ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite
54 self.extraresults["ptestresult.sections"][ptestsuite] = {} 55 self.ptest_section(ptestsuite, logfile = logpath)
55 with open(sumspath, "r") as f: 56 with open(sumspath, "r") as f:
56 for test, result in parse_values(f): 57 for test, result in parse_values(f):
57 self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result} 58 self.ptest_result(ptestsuite, test, result)
58 59
59 def run_check_emulated(self, *args, **kwargs): 60 def run_check_emulated(self, *args, **kwargs):
60 # build core-image-minimal with required packages 61 # build core-image-minimal with required packages