summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYash Shinde <Yash.Shinde@windriver.com>2023-08-01 05:47:16 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-04 11:44:28 +0100
commit2d2860206f0b1104847d740c71452eb780cce983 (patch)
tree3b51de70cd5f537b514a8929a7de8b7a74d3e379
parent468b9fa03464777e25ad08424236c89389bdb597 (diff)
downloadpoky-2d2860206f0b1104847d740c71452eb780cce983.tar.gz
oeqa/selftest/glibc: Add elapsed time for glibc test report.
Capture the time taken for glibc test execution and pass it for inclusion in the test report. [YOCTO #15165] (From OE-Core rev: 0c35f931c1ddae8d07bad7e2c70ccbc14beaf44d) 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>
-rw-r--r--meta/lib/oeqa/selftest/cases/glibc.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/glibc.py b/meta/lib/oeqa/selftest/cases/glibc.py
index 924df6c5a6..bd56b2f6e7 100644
--- a/meta/lib/oeqa/selftest/cases/glibc.py
+++ b/meta/lib/oeqa/selftest/cases/glibc.py
@@ -4,6 +4,7 @@
4# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
5# 5#
6import os 6import os
7import time
7import contextlib 8import contextlib
8from oeqa.core.decorator import OETestTag 9from oeqa.core.decorator import OETestTag
9from oeqa.core.case import OEPTestResultTestCase 10from oeqa.core.case import OEPTestResultTestCase
@@ -31,12 +32,16 @@ class GlibcSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
31 features.append('EGLIBCPARALLELISM:task-check:pn-glibc-testsuite = "PARALLELMFLAGS="-j1""') 32 features.append('EGLIBCPARALLELISM:task-check:pn-glibc-testsuite = "PARALLELMFLAGS="-j1""')
32 self.write_config("\n".join(features)) 33 self.write_config("\n".join(features))
33 34
35 start_time = time.time()
36
34 bitbake("glibc-testsuite -c check") 37 bitbake("glibc-testsuite -c check")
35 38
39 end_time = time.time()
40
36 builddir = get_bb_var("B", "glibc-testsuite") 41 builddir = get_bb_var("B", "glibc-testsuite")
37 42
38 ptestsuite = "glibc-user" if ssh is None else "glibc" 43 ptestsuite = "glibc-user" if ssh is None else "glibc"
39 self.ptest_section(ptestsuite) 44 self.ptest_section(ptestsuite, duration = int(end_time - start_time))
40 with open(os.path.join(builddir, "tests.sum"), "r", errors='replace') as f: 45 with open(os.path.join(builddir, "tests.sum"), "r", errors='replace') as f:
41 for test, result in parse_values(f): 46 for test, result in parse_values(f):
42 self.ptest_result(ptestsuite, test, result) 47 self.ptest_result(ptestsuite, test, result)