summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYash Shinde <Yash.Shinde@windriver.com>2023-08-01 05:47:14 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-08-04 11:44:28 +0100
commitc9a9a950441d5c9aa808de99127eb02521c0e0da (patch)
tree30e3ce7b5e1a2b712b199ff2dbad5637b0ddd07c
parent266af294a26e1ad8b8983baca51ff330db254af1 (diff)
downloadpoky-c9a9a950441d5c9aa808de99127eb02521c0e0da.tar.gz
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 <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/binutils.py7
1 files changed, 6 insertions, 1 deletions
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 @@
4# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
5# 5#
6import os 6import os
7import time
7from oeqa.core.decorator import OETestTag 8from oeqa.core.decorator import OETestTag
8from oeqa.core.case import OEPTestResultTestCase 9from oeqa.core.case import OEPTestResultTestCase
9from oeqa.selftest.case import OESelftestTestCase 10from oeqa.selftest.case import OESelftestTestCase
@@ -36,15 +37,19 @@ class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase):
36 bb_vars = get_bb_vars(["B", "TARGET_SYS", "T"], recipe) 37 bb_vars = get_bb_vars(["B", "TARGET_SYS", "T"], recipe)
37 builddir, target_sys, tdir = bb_vars["B"], bb_vars["TARGET_SYS"], bb_vars["T"] 38 builddir, target_sys, tdir = bb_vars["B"], bb_vars["TARGET_SYS"], bb_vars["T"]
38 39
40 start_time = time.time()
41
39 bitbake("{0} -c check".format(recipe)) 42 bitbake("{0} -c check".format(recipe))
40 43
44 end_time = time.time()
45
41 sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite)) 46 sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite))
42 if not os.path.exists(sumspath): 47 if not os.path.exists(sumspath):
43 sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite)) 48 sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite))
44 logpath = os.path.splitext(sumspath)[0] + ".log" 49 logpath = os.path.splitext(sumspath)[0] + ".log"
45 50
46 ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite 51 ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
47 self.ptest_section(ptestsuite, logfile = logpath) 52 self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath)
48 with open(sumspath, "r") as f: 53 with open(sumspath, "r") as f:
49 for test, result in parse_values(f): 54 for test, result in parse_values(f):
50 self.ptest_result(ptestsuite, test, result) 55 self.ptest_result(ptestsuite, test, result)