[Piglit] [PATCH 09/15] framework: Move PLATFORMS list to core

Dylan Baker baker.dylan.c at gmail.com
Fri Oct 3 17:57:50 PDT 2014


This allows the PLATFORMS list to be readily shared, and will be used in
the next patch.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 framework/core.py         | 12 ++++++++----
 framework/programs/run.py |  9 +++------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/framework/core.py b/framework/core.py
index 36e0859..9f50c2e 100644
--- a/framework/core.py
+++ b/framework/core.py
@@ -31,12 +31,16 @@ import sys
 # TODO: ConfigParser is known as configparser in python3
 import ConfigParser
 
-__all__ = ['PIGLIT_CONFIG',
-           'Options',
-           'collect_system_info',
-           'parse_listfile']
+__all__ = [
+    'PIGLIT_CONFIG',
+    'PLATFORMS',
+    'Options',
+    'collect_system_info',
+    'parse_listfile',
+]
 
 
+PLATFORMS = ["glx", "x11_egl", "wayland", "gbm", "mixed_glx_egl"]
 PIGLIT_CONFIG = ConfigParser.SafeConfigParser(allow_no_value=True)
 
 def get_config(arg=None):
diff --git a/framework/programs/run.py b/framework/programs/run.py
index bd48fa8..15f6ec6 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -37,9 +37,6 @@ __all__ = ['run',
            'resume']
 
 
-_PLATFORMS = ["glx", "x11_egl", "wayland", "gbm", "mixed_glx_egl"]
-
-
 def _default_platform():
     """ Logic to determine the default platform to use
 
@@ -61,9 +58,9 @@ def _default_platform():
     else:
         try:
             plat = core.PIGLIT_CONFIG.get('core', 'platform')
-            if plat not in _PLATFORMS:
+            if plat not in core.PLATFORMS:
                 print('Platform is not valid\n'
-                      'valid platforms are: {}'.format(_PLATFORMS),
+                      'valid platforms are: {}'.format(core.PLATFORMS),
                       file=sys.stderr)
                 sys.exit(1)
             return plat
@@ -145,7 +142,7 @@ def _run_parser(input_):
                              dest="concurrency",
                              help="Disable concurrent test runs")
     parser.add_argument("-p", "--platform",
-                        choices=_PLATFORMS,
+                        choices=core.PLATFORMS,
                         default=_default_platform(),
                         help="Name of windows system passed to waffle")
     parser.add_argument("--valgrind",
-- 
2.1.2



More information about the Piglit mailing list