ext: Add timing indications to every TestCase
The log_call helper is now accepting a time parameter (dictionary). If the param is not None, the function will fill the timing indications (user and system time) for the TestCase. There are some TestCases whose user time is not of our interest; for example we don't really care about the cpu time of a stdout diff (MatchStdout tests). In those cases the resulting cpu time in the generated JUnit file (results.xml) will be 0. JIRA: https://gem5.atlassian.net/browse/GEM5-548 Change-Id: I53c1b59f8ad93900aeac06197e39189c00a9053c Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32653 Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -170,7 +170,7 @@ class SConsFixture(UniqueFixture):
|
||||
command.extend(self.targets)
|
||||
if self.options:
|
||||
command.extend(self.options)
|
||||
log_call(log.test_log, command, stderr=sys.stderr)
|
||||
log_call(log.test_log, command, time=None, stderr=sys.stderr)
|
||||
|
||||
class Gem5Fixture(SConsFixture):
|
||||
def __new__(cls, isa, variant, protocol=None):
|
||||
@@ -208,7 +208,7 @@ class MakeFixture(Fixture):
|
||||
targets = set(self.required_by)
|
||||
command = ['make', '-C', self.directory]
|
||||
command.extend([target.target for target in targets])
|
||||
log_call(log.test_log, command, stderr=sys.stderr)
|
||||
log_call(log.test_log, command, time=None, stderr=sys.stderr)
|
||||
|
||||
|
||||
class MakeTarget(Fixture):
|
||||
|
||||
@@ -176,6 +176,7 @@ def _create_test_run_gem5(config, config_args, gem5_args):
|
||||
command.append(config)
|
||||
# Config_args should set up the program args.
|
||||
command.extend(config_args)
|
||||
log_call(params.log, command, stdout=sys.stdout, stderr=sys.stderr)
|
||||
log_call(params.log, command, time=params.time,
|
||||
stdout=sys.stdout, stderr=sys.stderr)
|
||||
|
||||
return test_run_gem5
|
||||
|
||||
Reference in New Issue
Block a user