import re
import logging
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars
break
@OETestTag("toolchain-user", "toolchain-system")
-class BinutilsCrossSelfTest(OESelftestTestCase):
+class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase):
def test_binutils(self):
self.run_binutils("binutils")
bitbake("{0} -c check".format(recipe))
- ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
- self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
-
sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite))
if not os.path.exists(sumspath):
sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite))
+ logpath = os.path.splitext(sumspath)[0] + ".log"
+ ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
+ self.ptest_section(ptestsuite, logfile = logpath)
with open(sumspath, "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
# SPDX-License-Identifier: MIT
import os
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
yield i[len(v) + 2:].strip(), v
break
-class GccSelfTestBase(OESelftestTestCase):
+class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
def check_skip(self, suite):
targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split()
if suite not in targets:
bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe)
builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"]
- self.extraresults = {"ptestresult.sections" : {}}
for suite in suites:
sumspath = os.path.join(builddir, "gcc", "testsuite", suite, "{0}.sum".format(suite))
if not os.path.exists(sumspath): # check in target dirs
sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite))
if not os.path.exists(sumspath): # handle libstdc++-v3 -> libstdc++
sumspath = os.path.join(builddir, target_sys, suite, "testsuite", "{0}.sum".format(suite.split("-")[0]))
+ logpath = os.path.splitext(sumspath)[0] + ".log"
ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite
ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite
- self.extraresults["ptestresult.sections"][ptestsuite] = {}
+ self.ptest_section(ptestsuite, logfile = logpath)
with open(sumspath, "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
def run_check_emulated(self, *args, **kwargs):
# build core-image-minimal with required packages
import os
import contextlib
from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command
from oeqa.utils.nfs import unfs_server
yield i[len(v) + 2:].strip(), v
break
-class GlibcSelfTestBase(OESelftestTestCase):
+class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
def run_check(self, ssh = None):
# configure ssh target
features = []
builddir = get_bb_var("B", "glibc-testsuite")
ptestsuite = "glibc-user" if ssh is None else "glibc"
- self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}}
+ self.ptest_section(ptestsuite)
with open(os.path.join(builddir, "tests.sum"), "r") as f:
for test, result in parse_values(f):
- self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
+ self.ptest_result(ptestsuite, test, result)
def run_check_emulated(self):
with contextlib.ExitStack() as s: