diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2019-09-11 14:13:07 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-09-16 23:02:43 +0100 |
commit | 6c7d657aaeb223c3136e916da34468af468397b7 (patch) | |
tree | 8d9657740e0b70d18f845052f5bbb65ad96f51f5 /meta/lib/oeqa/selftest/cases/binutils.py | |
parent | e08f657220fa119793949e26b2837026956d4238 (diff) | |
download | poky-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/binutils.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/binutils.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/binutils.py b/meta/lib/oeqa/selftest/cases/binutils.py index 9bc752040f..821f52f5a8 100644 --- a/meta/lib/oeqa/selftest/cases/binutils.py +++ b/meta/lib/oeqa/selftest/cases/binutils.py | |||
@@ -4,6 +4,7 @@ import sys | |||
4 | import re | 4 | import re |
5 | import logging | 5 | import logging |
6 | from oeqa.core.decorator import OETestTag | 6 | from oeqa.core.decorator import OETestTag |
7 | from oeqa.core.case import OEPTestResultTestCase | ||
7 | from oeqa.selftest.case import OESelftestTestCase | 8 | from oeqa.selftest.case import OESelftestTestCase |
8 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars | 9 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars |
9 | 10 | ||
@@ -15,7 +16,7 @@ def parse_values(content): | |||
15 | break | 16 | break |
16 | 17 | ||
17 | @OETestTag("toolchain-user", "toolchain-system") | 18 | @OETestTag("toolchain-user", "toolchain-system") |
18 | class BinutilsCrossSelfTest(OESelftestTestCase): | 19 | class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase): |
19 | def test_binutils(self): | 20 | def test_binutils(self): |
20 | self.run_binutils("binutils") | 21 | self.run_binutils("binutils") |
21 | 22 | ||
@@ -36,14 +37,14 @@ class BinutilsCrossSelfTest(OESelftestTestCase): | |||
36 | 37 | ||
37 | bitbake("{0} -c check".format(recipe)) | 38 | bitbake("{0} -c check".format(recipe)) |
38 | 39 | ||
39 | ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite | ||
40 | self.extraresults = {"ptestresult.sections" : {ptestsuite : {}}} | ||
41 | |||
42 | sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite)) | 40 | sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite)) |
43 | if not os.path.exists(sumspath): | 41 | if not os.path.exists(sumspath): |
44 | sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite)) | 42 | sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite)) |
43 | logpath = os.path.splitext(sumspath)[0] + ".log" | ||
45 | 44 | ||
45 | ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite | ||
46 | self.ptest_section(ptestsuite, logfile = logpath) | ||
46 | with open(sumspath, "r") as f: | 47 | with open(sumspath, "r") as f: |
47 | for test, result in parse_values(f): | 48 | for test, result in parse_values(f): |
48 | self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result} | 49 | self.ptest_result(ptestsuite, test, result) |
49 | 50 | ||