Commit 81a091ae authored by Dylan Baker's avatar Dylan Baker

Add support to load multiple test profiles

This patch gives piglit run the ability to take one or more test
proflies as arguments rather than just one. It loads the profiles,
merging them from left to right, overwriting conflicting results. This
will allow the oglconform and es3conform loaders to be taken out of
Acked-by: Daniel Vetter's avatarDaniel Vetter <>
Reviewed-by: Kenneth Graunke (AFK until mid-April)'s avatarKenneth Graunke <>
Signed-off-by: Dylan Baker's avatarDylan Baker <>
parent 2b42fa0f
......@@ -616,6 +616,22 @@ class TestProfile:
group = group[group_name]
del group[l[-1]]
def update(self, *profiles):
""" Updates the contents of this TestProfile instance with another
This method overwrites key:value pairs in self with those in the
provided profiles argument. This allows multiple TestProfiles to be
called in the same run; which could be used to run piglit and external
suites at the same time.
profiles -- one or more TestProfile-like objects to be merged.
for profile in profiles:
def loadTestProfile(filename):
ns = {'__file__': filename}
......@@ -627,6 +643,22 @@ def loadTestProfile(filename):
return ns['profile']
def merge_test_profiles(profiles):
""" Helper for loading and merging TestProfile instances
Takes paths to test profiles as arguments and returns a single merged
TestPRofile instance.
profiles -- a list of one or more paths to profile files.
profile = loadTestProfile(profiles.pop())
for p in profiles:
return profile
def load_results(filename):
""" Loader function for TestrunResult class
......@@ -74,7 +74,7 @@ def main():
json_writer.write_dict_item(key, value)
profile = core.loadTestProfile(results.options['profile'])
profile = core.merge_test_profiles(results.options['profile'])
# This is resumed, don't bother with time since it wont be accurate anyway, json_writer)
......@@ -80,7 +80,8 @@ def main():
help="Capture a difference in dmesg before and "
"after each test")
metavar="<Path to test profile>",
metavar="<Path to one or more test profile(s)>",
help="Path to testfile to run")
......@@ -134,7 +135,7 @@ def main():
for (key, value) in env.collectData().items():
json_writer.write_dict_item(key, value)
profile = core.loadTestProfile(args.test_profile)
profile = core.merge_test_profiles(args.test_profile)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment