diff options
author | Yash Shinde <Yash.Shinde@windriver.com> | 2023-08-01 05:47:15 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-08-04 11:44:28 +0100 |
commit | 468b9fa03464777e25ad08424236c89389bdb597 (patch) | |
tree | 982088526cf41756c1e1caf088fbfb90dc903640 /meta | |
parent | c9a9a950441d5c9aa808de99127eb02521c0e0da (diff) | |
download | poky-468b9fa03464777e25ad08424236c89389bdb597.tar.gz |
oeqa/selftest/gcc: Add elapsed time for gcc test report.
Capture the time taken for gcc test execution and
pass it for inclusion in the test report.
[YOCTO #15165]
(From OE-Core rev: 3c8f1e6d7d8a4a60b4153f4458a657d23f190e71)
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/gcc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py index 6b9022e461..89360178fe 100644 --- a/meta/lib/oeqa/selftest/cases/gcc.py +++ b/meta/lib/oeqa/selftest/cases/gcc.py | |||
@@ -4,6 +4,7 @@ | |||
4 | # SPDX-License-Identifier: MIT | 4 | # SPDX-License-Identifier: MIT |
5 | # | 5 | # |
6 | import os | 6 | import os |
7 | import time | ||
7 | from oeqa.core.decorator import OETestTag | 8 | from oeqa.core.decorator import OETestTag |
8 | from oeqa.core.case import OEPTestResultTestCase | 9 | from oeqa.core.case import OEPTestResultTestCase |
9 | from oeqa.selftest.case import OESelftestTestCase | 10 | from oeqa.selftest.case import OESelftestTestCase |
@@ -43,8 +44,13 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): | |||
43 | self.write_config("\n".join(features)) | 44 | self.write_config("\n".join(features)) |
44 | 45 | ||
45 | recipe = "gcc-runtime" | 46 | recipe = "gcc-runtime" |
47 | |||
48 | start_time = time.time() | ||
49 | |||
46 | bitbake("{} -c check".format(recipe)) | 50 | bitbake("{} -c check".format(recipe)) |
47 | 51 | ||
52 | end_time = time.time() | ||
53 | |||
48 | bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) | 54 | bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) |
49 | builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] | 55 | builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] |
50 | 56 | ||
@@ -58,7 +64,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): | |||
58 | 64 | ||
59 | ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite | 65 | ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite |
60 | ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite | 66 | ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite |
61 | self.ptest_section(ptestsuite, logfile = logpath) | 67 | self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath) |
62 | with open(sumspath, "r") as f: | 68 | with open(sumspath, "r") as f: |
63 | for test, result in parse_values(f): | 69 | for test, result in parse_values(f): |
64 | self.ptest_result(ptestsuite, test, result) | 70 | self.ptest_result(ptestsuite, test, result) |