Commit b2b1638c authored by Dylan Baker's avatar Dylan Baker

Save and restore platform for piglit

This patch adds support in piglit-run to save the -p platform
information if it was provided, and adds support in piglit-resume to
restore this information if it is stored.
Signed-off-by: Dylan Baker's avatarDylan Baker <baker.dylan.c@gmail.com>
parent d2445848
......@@ -48,6 +48,13 @@ def main():
# Change working directory to the piglit directory
os.chdir(path.dirname(path.realpath(sys.argv[0])))
# attempt to restore a saved platform, if there is no saved platform just
# go on
try:
os.environ['PIGLIT_PLATFORM'] = results.options['platform']
except KeyError:
pass
results_path = path.join(args.results_path, "main")
json_writer = core.JSONWriter(open(results_path, 'w+'))
json_writer.open_dict()
......
......@@ -125,9 +125,12 @@ def main():
json_writer.write_dict_item('profile', args.test_profile)
for key, value in env:
json_writer.write_dict_item(key, value)
if args.platform:
json_writer.write_dict_item('platform', args.platform)
json_writer.close_dict()
json_writer.write_dict_item('name', results.name)
for (key, value) in env.collectData().items():
json_writer.write_dict_item(key, value)
......
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