From: Yash Shinde Date: Tue, 1 Aug 2023 12:47:15 +0000 (-0700) Subject: oeqa/selftest/gcc: Add elapsed time for gcc test report. X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c8f1e6d7d8a4a60b4153f4458a657d23f190e71;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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] Signed-off-by: Yash Shinde Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/lib/oeqa/selftest/cases/gcc.py b/meta/lib/oeqa/selftest/cases/gcc.py index 6b9022e4619..89360178fec 100644 --- a/meta/lib/oeqa/selftest/cases/gcc.py +++ b/meta/lib/oeqa/selftest/cases/gcc.py @@ -4,6 +4,7 @@ # SPDX-License-Identifier: MIT # import os +import time from oeqa.core.decorator import OETestTag from oeqa.core.case import OEPTestResultTestCase from oeqa.selftest.case import OESelftestTestCase @@ -43,8 +44,13 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): self.write_config("\n".join(features)) recipe = "gcc-runtime" + + start_time = time.time() + bitbake("{} -c check".format(recipe)) + end_time = time.time() + bb_vars = get_bb_vars(["B", "TARGET_SYS"], recipe) builddir, target_sys = bb_vars["B"], bb_vars["TARGET_SYS"] @@ -58,7 +64,7 @@ class GccSelfTestBase(OESelftestTestCase, OEPTestResultTestCase): ptestsuite = "gcc-{}".format(suite) if suite != "gcc" else suite ptestsuite = ptestsuite + "-user" if ssh is None else ptestsuite - self.ptest_section(ptestsuite, logfile = logpath) + self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath) with open(sumspath, "r") as f: for test, result in parse_values(f): self.ptest_result(ptestsuite, test, result)