From c9a9a950441d5c9aa808de99127eb02521c0e0da Mon Sep 17 00:00:00 2001 From: Yash Shinde Date: Tue, 1 Aug 2023 05:47:14 -0700 Subject: oeqa/selftest/binutils: Add elapsed time for binutils test report. Capture the time taken for binutils test execution and pass it for inclusion in the test report. [YOCTO #15165] (From OE-Core rev: 82bdacb048134945821c5329a215bcbd9692bdb3) Signed-off-by: Yash Shinde Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/binutils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'meta/lib/oeqa/selftest/cases/binutils.py') diff --git a/meta/lib/oeqa/selftest/cases/binutils.py b/meta/lib/oeqa/selftest/cases/binutils.py index bf6fdca0d9..1688eabe4e 100644 --- a/meta/lib/oeqa/selftest/cases/binutils.py +++ b/meta/lib/oeqa/selftest/cases/binutils.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 @@ -36,15 +37,19 @@ class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase): bb_vars = get_bb_vars(["B", "TARGET_SYS", "T"], recipe) builddir, target_sys, tdir = bb_vars["B"], bb_vars["TARGET_SYS"], bb_vars["T"] + start_time = time.time() + bitbake("{0} -c check".format(recipe)) + end_time = time.time() + sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite)) if not os.path.exists(sumspath): sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite)) logpath = os.path.splitext(sumspath)[0] + ".log" ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite - 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) -- cgit v1.2.3-54-g00ecf