[Piglit] [PATCH] Save and restore platform for piglit

Dylan Baker baker.dylan.c at gmail.com
Thu Dec 19 16:31:22 PST 2013


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.

CC: kenneth at whitecape.org
Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 piglit-resume.py | 7 +++++--
 piglit-run.py    | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/piglit-resume.py b/piglit-resume.py
index ae5de9b..16d0b3f 100755
--- a/piglit-resume.py
+++ b/piglit-resume.py
@@ -47,7 +47,10 @@ def main():
     
     # Change working directory to the piglit directory
     os.chdir(path.dirname(path.realpath(sys.argv[0])))
-    
+
+    if results.options['platform']:
+        os.environ['PIGLIT_PLATFORM'] = results.options['platform']
+
     results_path = path.join(args.results_path, "main")
     json_writer = core.JSONWriter(open(results_path, 'w+'))
     json_writer.open_dict()
@@ -81,4 +84,4 @@ def main():
           "Results have ben wrriten to {0}".format(results_path))
     
 if __name__ == "__main__":
-    main()
\ No newline at end of file
+    main()
diff --git a/piglit-run.py b/piglit-run.py
index c4bed93..ea6d1d8 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -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)
 
-- 
1.8.5.2



More information about the Piglit mailing list