diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/gcc.py | 101 |
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") | 14 | class GccSelfTestBase(OESelftestTestCase): |
15 | class 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 | ||
80 | class 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") | ||
77 | class GccCrossSelfTest(GccSelfTestBase): | ||
78 | def test_cross_gcc(self): | ||
79 | self.run_check("gcc", "g++") | ||
80 | |||
81 | @OETestTag("toolchain-user") | ||
82 | class GccLibAtomicSelfTest(GccSelfTestBase): | ||
83 | def test_libatomic(self): | ||
84 | self.run_check("libatomic") | ||
85 | |||
86 | @OETestTag("toolchain-user") | ||
87 | class GccLibGompSelfTest(GccSelfTestBase): | ||
88 | def test_libgomp(self): | ||
89 | self.run_check("libgomp") | ||
90 | |||
91 | @OETestTag("toolchain-user") | ||
92 | class GccLibStdCxxSelfTest(GccSelfTestBase): | ||
93 | def test_libstdcxx(self): | ||
94 | self.run_check("libstdc++-v3") | ||
95 | |||
96 | @OETestTag("toolchain-user") | ||
97 | class GccLibSspSelfTest(GccSelfTestBase): | ||
98 | def test_libssp(self): | ||
99 | self.check_skip("libssp") | ||
100 | self.run_check("libssp") | ||
101 | |||
102 | @OETestTag("toolchain-user") | ||
103 | class GccLibItmSelfTest(GccSelfTestBase): | ||
104 | def test_libitm(self): | ||
105 | self.check_skip("libitm") | ||
106 | self.run_check("libitm") | ||
107 | |||
108 | @OETestTag("toolchain-system") | ||
109 | class GccCrossSelfTestSystemEmulated(GccSelfTestBase): | ||
110 | def test_cross_gcc(self): | ||
111 | self.run_check_emulated("gcc", "g++") | ||
112 | |||
113 | @OETestTag("toolchain-system") | ||
114 | class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): | ||
115 | def test_libatomic(self): | ||
116 | self.run_check_emulated("libatomic") | ||
117 | |||
118 | @OETestTag("toolchain-system") | ||
119 | class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): | ||
120 | def test_libgomp(self): | ||
121 | self.run_check_emulated("libgomp") | ||
122 | |||
123 | @OETestTag("toolchain-system") | ||
124 | class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): | ||
125 | def test_libstdcxx(self): | ||
126 | self.run_check_emulated("libstdc++-v3") | ||
127 | |||
128 | @OETestTag("toolchain-system") | ||
129 | class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): | ||
130 | def test_libssp(self): | ||
131 | self.check_skip("libssp") | ||
132 | self.run_check_emulated("libssp") | ||
133 | |||
134 | @OETestTag("toolchain-system") | ||
135 | class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): | ||
136 | def test_libitm(self): | ||
137 | self.check_skip("libitm") | ||
138 | self.run_check_emulated("libitm") | ||
98 | 139 | ||