summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-09-07 12:55:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-07 21:56:43 +0100
commitfdb2bfa0b7ee3ebd4a9124ddda6f61db0e4519bc (patch)
treec09165e2a769a0be6b9404d34f1c9fb3a484ce7a /meta/lib
parentdcb84e42e51f9c7906435eef637d0010336ce6a5 (diff)
downloadpoky-fdb2bfa0b7ee3ebd4a9124ddda6f61db0e4519bc.tar.gz
oeqa/selftest/cases/gcc.py: Split into classes for parallelism
Split the gcc selftest cases into multiple classes one for each test. This is done in order to make it easy to execute multiple gcc tests in parallel when using oe-selftest with the '-j' arg. Additionally tag the user tests with "toolchain-user" and the system emulation (qemu system) tests with "toolchain-system". (From OE-Core rev: 7b2f03eff9fc9b4ce48d5ea7e54faa114a6cdcae) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/gcc.py101
1 files changed, 71 insertions, 30 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py
index 24ee66a2ae..2c25b5904c 100644
--- a/meta/lib/oeqa/selftest/cases/gcc.py
+++ b/meta/lib/oeqa/selftest/cases/gcc.py
@@ -11,34 +11,13 @@ def parse_values(content):
11 yield i[len(v) + 2:].strip(), v 11 yield i[len(v) + 2:].strip(), v
12 break 12 break
13 13
14@OETestTag("machine") 14class GccSelfTestBase(OESelftestTestCase):
15class GccSelfTest(OESelftestTestCase): 15 def check_skip(self, suite):
16 def gcc_runtime_check_skip(self, suite):
17 targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split() 16 targets = get_bb_var("RUNTIMETARGET", "gcc-runtime").split()
18 if suite not in targets: 17 if suite not in targets:
19 self.skipTest("Target does not use {0}".format(suite)) 18 self.skipTest("Target does not use {0}".format(suite))
20 19
21 def test_cross_gcc(self): 20 def run_check(self, *suites, ssh = None):
22 self.gcc_run_check("gcc", "g++")
23
24 def test_libatomic(self):
25 self.gcc_run_check("libatomic")
26
27 def test_libgomp(self):
28 self.gcc_run_check("libgomp")
29
30 def test_libstdcxx(self):
31 self.gcc_run_check("libstdc++-v3")
32
33 def test_libssp(self):
34 self.gcc_runtime_check_skip("libssp")
35 self.gcc_run_check("libssp")
36
37 def test_libitm(self):
38 self.gcc_runtime_check_skip("libitm")
39 self.gcc_run_check("libitm")
40
41 def gcc_run_check(self, *suites, ssh = None):
42 targets = set() 21 targets = set()
43 for s in suites: 22 for s in suites:
44 if s in ["gcc", "g++"]: 23 if s in ["gcc", "g++"]:
@@ -77,14 +56,12 @@ class GccSelfTest(OESelftestTestCase):
77 for test, result in parse_values(f): 56 for test, result in parse_values(f):
78 self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result} 57 self.extraresults["ptestresult.{}.{}".format(ptestsuite, test)] = {"status" : result}
79 58
80class GccSelfTestSystemEmulated(GccSelfTest): 59 def run_check_emulated(self, *args, **kwargs):
81 default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
82
83 def gcc_run_check(self, *args, **kwargs):
84 # build core-image-minimal with required packages 60 # build core-image-minimal with required packages
61 default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
85 features = [] 62 features = []
86 features.append('IMAGE_FEATURES += "ssh-server-openssh"') 63 features.append('IMAGE_FEATURES += "ssh-server-openssh"')
87 features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(self.default_installed_packages))) 64 features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
88 self.write_config("\n".join(features)) 65 self.write_config("\n".join(features))
89 bitbake("core-image-minimal") 66 bitbake("core-image-minimal")
90 67
@@ -94,5 +71,69 @@ class GccSelfTestSystemEmulated(GccSelfTest):
94 status, _ = qemu.run("uname") 71 status, _ = qemu.run("uname")
95 self.assertEqual(status, 0) 72 self.assertEqual(status, 0)
96 73
97 return super().gcc_run_check(*args, ssh=qemu.ip, **kwargs) 74 return self.run_check(*args, ssh=qemu.ip, **kwargs)
75
76@OETestTag("toolchain-user")
77class GccCrossSelfTest(GccSelfTestBase):
78 def test_cross_gcc(self):
79 self.run_check("gcc", "g++")
80
81@OETestTag("toolchain-user")
82class GccLibAtomicSelfTest(GccSelfTestBase):
83 def test_libatomic(self):
84 self.run_check("libatomic")
85
86@OETestTag("toolchain-user")
87class GccLibGompSelfTest(GccSelfTestBase):
88 def test_libgomp(self):
89 self.run_check("libgomp")
90
91@OETestTag("toolchain-user")
92class GccLibStdCxxSelfTest(GccSelfTestBase):
93 def test_libstdcxx(self):
94 self.run_check("libstdc++-v3")
95
96@OETestTag("toolchain-user")
97class GccLibSspSelfTest(GccSelfTestBase):
98 def test_libssp(self):
99 self.check_skip("libssp")
100 self.run_check("libssp")
101
102@OETestTag("toolchain-user")
103class GccLibItmSelfTest(GccSelfTestBase):
104 def test_libitm(self):
105 self.check_skip("libitm")
106 self.run_check("libitm")
107
108@OETestTag("toolchain-system")
109class GccCrossSelfTestSystemEmulated(GccSelfTestBase):
110 def test_cross_gcc(self):
111 self.run_check_emulated("gcc", "g++")
112
113@OETestTag("toolchain-system")
114class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase):
115 def test_libatomic(self):
116 self.run_check_emulated("libatomic")
117
118@OETestTag("toolchain-system")
119class GccLibGompSelfTestSystemEmulated(GccSelfTestBase):
120 def test_libgomp(self):
121 self.run_check_emulated("libgomp")
122
123@OETestTag("toolchain-system")
124class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase):
125 def test_libstdcxx(self):
126 self.run_check_emulated("libstdc++-v3")
127
128@OETestTag("toolchain-system")
129class GccLibSspSelfTestSystemEmulated(GccSelfTestBase):
130 def test_libssp(self):
131 self.check_skip("libssp")
132 self.run_check_emulated("libssp")
133
134@OETestTag("toolchain-system")
135class GccLibItmSelfTestSystemEmulated(GccSelfTestBase):
136 def test_libitm(self):
137 self.check_skip("libitm")
138 self.run_check_emulated("libitm")
98 139