summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/binutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/binutils.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/binutils.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/binutils.py b/meta/lib/oeqa/selftest/cases/binutils.py
index 821f52f5a8..1688eabe4e 100644
--- a/meta/lib/oeqa/selftest/cases/binutils.py
+++ b/meta/lib/oeqa/selftest/cases/binutils.py
@@ -1,12 +1,14 @@
1#
2# Copyright OpenEmbedded Contributors
3#
1# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
5#
2import os 6import os
3import sys 7import time
4import re
5import logging
6from oeqa.core.decorator import OETestTag 8from oeqa.core.decorator import OETestTag
7from oeqa.core.case import OEPTestResultTestCase 9from oeqa.core.case import OEPTestResultTestCase
8from oeqa.selftest.case import OESelftestTestCase 10from oeqa.selftest.case import OESelftestTestCase
9from oeqa.utils.commands import bitbake, get_bb_var, get_bb_vars 11from oeqa.utils.commands import bitbake, get_bb_vars
10 12
11def parse_values(content): 13def parse_values(content):
12 for i in content: 14 for i in content:
@@ -35,15 +37,19 @@ class BinutilsCrossSelfTest(OESelftestTestCase, OEPTestResultTestCase):
35 bb_vars = get_bb_vars(["B", "TARGET_SYS", "T"], recipe) 37 bb_vars = get_bb_vars(["B", "TARGET_SYS", "T"], recipe)
36 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"]
37 39
40 start_time = time.time()
41
38 bitbake("{0} -c check".format(recipe)) 42 bitbake("{0} -c check".format(recipe))
39 43
44 end_time = time.time()
45
40 sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite)) 46 sumspath = os.path.join(builddir, suite, "{0}.sum".format(suite))
41 if not os.path.exists(sumspath): 47 if not os.path.exists(sumspath):
42 sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite)) 48 sumspath = os.path.join(builddir, suite, "testsuite", "{0}.sum".format(suite))
43 logpath = os.path.splitext(sumspath)[0] + ".log" 49 logpath = os.path.splitext(sumspath)[0] + ".log"
44 50
45 ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite 51 ptestsuite = "binutils-{}".format(suite) if suite != "binutils" else suite
46 self.ptest_section(ptestsuite, logfile = logpath) 52 self.ptest_section(ptestsuite, duration = int(end_time - start_time), logfile = logpath)
47 with open(sumspath, "r") as f: 53 with open(sumspath, "r") as f:
48 for test, result in parse_values(f): 54 for test, result in parse_values(f):
49 self.ptest_result(ptestsuite, test, result) 55 self.ptest_result(ptestsuite, test, result)