[Piglit] [Patch v2 12/18] run.py: Explicitly set the piglit platform by using a default

Dylan Baker baker.dylan.c at gmail.com
Mon Jul 28 15:35:21 PDT 2014


This patch changes piglit such that the python framework always is aware
of the waffle platform being used. This does not change the default
platform, only that the python framework is aware of the default
platform.

v2: - Replace 'gl=>glx,gles=<xegl' name with 'mixed_glx_egl'. This name
      is not as descriptive as the previous name, but it is shorter and
      includes fewer strange symbols.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/programs/run.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index aeab279..ff75afe 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -73,6 +73,11 @@ def run(input_):
     parser.add_argument("-p", "--platform",
                         choices=["glx", "x11_egl", "wayland", "gbm",
                                  "mixed_glx_egl"],
+                        # If an explicit choice isn't made check the
+                        # environment, and if that fails select the glx/x11_egl
+                        # mixed profile
+                        default=os.environ.get("PIGLIT_PLATFORM",
+                                               "mixed_glx_egl"),
                         help="Name of windows system passed to waffle")
     parser.add_argument("-f", "--config",
                         dest="config_file",
@@ -136,8 +141,7 @@ def run(input_):
                         verbose=args.verbose)
 
     # Set the platform to pass to waffle
-    if args.platform:
-        opts.env['PIGLIT_PLATFORM'] = args.platform
+    opts.env['PIGLIT_PLATFORM'] = args.platform
 
     # Change working directory to the root of the piglit directory
     piglit_dir = path.dirname(path.realpath(sys.argv[0]))
@@ -216,8 +220,7 @@ def resume(input_):
 
     core.get_config(args.config_file)
 
-    if results.options.get('platform'):
-        opts.env['PIGLIT_PLATFORM'] = results.options['platform']
+    opts.env['PIGLIT_PLATFORM'] = results.options['platform']
 
     results_path = path.join(args.results_path, 'results.json')
     json_writer = framework.results.JSONWriter(open(results_path, 'w+'))
-- 
2.0.2



More information about the Piglit mailing list