1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

Fixing locally defined instruments erroneously propagating into global instrumentation

This commit is contained in:
Sergei Trofimov 2015-05-15 10:01:26 +01:00
parent 512bacc1be
commit a450957b9a
2 changed files with 17 additions and 1 deletions

View File

@ -686,7 +686,8 @@ class RunConfiguration(object):
default_config = self.ext_loader.get_default_config(extname)
ext_config[extname] = self._raw_config.get(identifier(extname), default_config)
list_name = '_global_{}'.format(attr_name)
setattr(self, list_name, raw_list)
global_list = self._raw_config.get(list_name, [])
setattr(self, list_name, global_list)
setattr(self, attr_name, ext_config)
def _finalize_device_config(self):

View File

@ -42,6 +42,14 @@ workloads:
- dhrystone
"""
INSTRUMENTATION_AGENDA_TEXT = """
config:
instrumentation: [execution_time]
workloads:
- dhrystone
- name: angrybirds
instrumentation: [fsp]
"""
class MockExtensionLoader(object):
@ -167,6 +175,13 @@ class ConfigTest(TestCase):
self.config.finalize()
assert_equal(self.config.instrumentation['list_params']['param'], [0.1, 0.1, 0.1])
def test_instrumentation_specification(self):
a = Agenda(INSTRUMENTATION_AGENDA_TEXT)
self.config.set_agenda(a)
self.config.finalize()
assert_equal(self.config.workload_specs[0].instrumentation, ['execution_time'])
assert_equal(self.config.workload_specs[1].instrumentation, ['fsp', 'execution_time'])
def test_remove_instrument(self):
self.config.load_config({'instrumentation': ['list_params']})
a = Agenda('{config: {instrumentation: [~list_params] }}')