diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/gcc.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/gcc.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py index 3efe15228f..89360178fe 100644 --- a/meta/lib/oeqa/selftest/cases/gcc.py +++ b/meta/lib/oeqa/selftest/cases/gcc.py | |||
@@ -1,9 +1,14 @@ | |||
1 | # | ||
2 | # Copyright OpenEmbedded Contributors | ||
3 | # | ||
1 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
5 | # | ||
2 | import os | 6 | import os |
7 | import time | ||
3 | from oeqa.core.decorator import OETestTag | 8 | from oeqa.core.decorator import OETestTag |
4 | from oeqa.core.case import OEPTestResultTestCase | 9 | from oeqa.core.case import OEPTestResultTestCase |
5 | from oeqa.selftest.case import OESelftestTestCase | 10 | from oeqa.selftest.case import OESelftestTestCase |
6 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu, Command | 11 | from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars, runqemu |
7 | 12 | ||
8 | def parse_values(content): | 13 | def parse_values(content): |
9 | for i in content: | 14 | for i in content: |
@@ -39,8 +44,13 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): | |||
39 | self.write_config("\n".join(features)) | 44 | self.write_config("\n".join(features)) |
40 | 45 | ||
41 | recipe = "gcc-runtime" | 46 | recipe = "gcc-runtime" |
47 | |||
48 | start_time = time.time() | ||
49 | |||
42 | bitbake("{} -c check".format(recipe)) | 50 | bitbake("{} -c check".format(recipe)) |
43 | 51 | ||
52 | end_time = time.time() | ||
53 | |||
44 | bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) | 54 | bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) |
45 | builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] | 55 | builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] |
46 | 56 | ||
@@ -54,7 +64,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): | |||
54 | 64 | ||
55 | ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite | 65 | ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite |
56 | ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite | 66 | ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite |
57 | self.ptest_section(ptestsuite, logfile = logpath) | 67 | self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath) |
58 | with open(sumspath, "r") as f: | 68 | with open(sumspath, "r") as f: |
59 | for test, result in parse_values(f): | 69 | for test, result in parse_values(f): |
60 | self.ptest_result(ptestsuite, test, result) | 70 | self.ptest_result(ptestsuite, test, result) |
@@ -114,37 +124,44 @@ class GccLibItmSelfTest(GccSelfTestBase): | |||
114 | self.run_check("libitm") | 124 | self.run_check("libitm") |
115 | 125 | ||
116 | @OETestTag("toolchain-system") | 126 | @OETestTag("toolchain-system") |
127 | @OETestTag("runqemu") | ||
117 | class GccCrossSelfTestSystemEmulated(GccSelfTestBase): | 128 | class GccCrossSelfTestSystemEmulated(GccSelfTestBase): |
118 | def test_cross_gcc(self): | 129 | def test_cross_gcc(self): |
119 | self.run_check_emulated("gcc") | 130 | self.run_check_emulated("gcc") |
120 | 131 | ||
121 | @OETestTag("toolchain-system") | 132 | @OETestTag("toolchain-system") |
133 | @OETestTag("runqemu") | ||
122 | class GxxCrossSelfTestSystemEmulated(GccSelfTestBase): | 134 | class GxxCrossSelfTestSystemEmulated(GccSelfTestBase): |
123 | def test_cross_gxx(self): | 135 | def test_cross_gxx(self): |
124 | self.run_check_emulated("g++") | 136 | self.run_check_emulated("g++") |
125 | 137 | ||
126 | @OETestTag("toolchain-system") | 138 | @OETestTag("toolchain-system") |
139 | @OETestTag("runqemu") | ||
127 | class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): | 140 | class GccLibAtomicSelfTestSystemEmulated(GccSelfTestBase): |
128 | def test_libatomic(self): | 141 | def test_libatomic(self): |
129 | self.run_check_emulated("libatomic") | 142 | self.run_check_emulated("libatomic") |
130 | 143 | ||
131 | @OETestTag("toolchain-system") | 144 | @OETestTag("toolchain-system") |
145 | @OETestTag("runqemu") | ||
132 | class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): | 146 | class GccLibGompSelfTestSystemEmulated(GccSelfTestBase): |
133 | def test_libgomp(self): | 147 | def test_libgomp(self): |
134 | self.run_check_emulated("libgomp") | 148 | self.run_check_emulated("libgomp") |
135 | 149 | ||
136 | @OETestTag("toolchain-system") | 150 | @OETestTag("toolchain-system") |
151 | @OETestTag("runqemu") | ||
137 | class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): | 152 | class GccLibStdCxxSelfTestSystemEmulated(GccSelfTestBase): |
138 | def test_libstdcxx(self): | 153 | def test_libstdcxx(self): |
139 | self.run_check_emulated("libstdc++-v3") | 154 | self.run_check_emulated("libstdc++-v3") |
140 | 155 | ||
141 | @OETestTag("toolchain-system") | 156 | @OETestTag("toolchain-system") |
157 | @OETestTag("runqemu") | ||
142 | class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): | 158 | class GccLibSspSelfTestSystemEmulated(GccSelfTestBase): |
143 | def test_libssp(self): | 159 | def test_libssp(self): |
144 | self.check_skip("libssp") | 160 | self.check_skip("libssp") |
145 | self.run_check_emulated("libssp") | 161 | self.run_check_emulated("libssp") |
146 | 162 | ||
147 | @OETestTag("toolchain-system") | 163 | @OETestTag("toolchain-system") |
164 | @OETestTag("runqemu") | ||
148 | class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): | 165 | class GccLibItmSelfTestSystemEmulated(GccSelfTestBase): |
149 | def test_libitm(self): | 166 | def test_libitm(self): |
150 | self.check_skip("libitm") | 167 | self.check_skip("libitm") |