summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/buildperf')
-rw-r--r--meta/lib/oeqa/buildperf/base.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 52c2ab61bf..fe18181f2b 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -23,7 +23,7 @@ import unittest
23from datetime import datetime, timedelta 23from datetime import datetime, timedelta
24from functools import partial 24from functools import partial
25 25
26from oeqa.utils.commands import runCmd, get_bb_vars 26from oeqa.utils.commands import CommandError, runCmd, get_bb_vars
27from oeqa.utils.git import GitError, GitRepo 27from oeqa.utils.git import GitError, GitRepo
28 28
29# Get logger for this module 29# Get logger for this module
@@ -216,9 +216,15 @@ class BuildPerfTestCase(unittest.TestCase):
216 216
217 def log_cmd_output(self, cmd): 217 def log_cmd_output(self, cmd):
218 """Run a command and log it's output""" 218 """Run a command and log it's output"""
219 cmd_str = cmd if isinstance(cmd, str) else ' '.join(cmd)
220 log.info("Logging command: %s", cmd_str)
219 cmd_log = os.path.join(self.out_dir, 'commands.log') 221 cmd_log = os.path.join(self.out_dir, 'commands.log')
220 with open(cmd_log, 'a') as fobj: 222 try:
221 runCmd2(cmd, stdout=fobj) 223 with open(cmd_log, 'a') as fobj:
224 runCmd2(cmd, stdout=fobj)
225 except CommandError as err:
226 log.error("Command failed: %s", err.retcode)
227 raise
222 228
223 def measure_cmd_resources(self, cmd, name, legend): 229 def measure_cmd_resources(self, cmd, name, legend):
224 """Measure system resource usage of a command""" 230 """Measure system resource usage of a command"""