[Piglit] [PATCH] framework/programs/run.py: Allow comments in test-list files.

Petri Latvala petri.latvala at intel.com
Wed Feb 1 10:57:45 UTC 2017


IGT testing in Intel's CI is using static lists of tests to
run. Commenting out tests and annotating them will help
human-readability.

v2: Use comprehensions (Dylan)

CC: Dylan Baker <dylan at pnwbakers.com>
Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---

Here's a version with comprehensions. Tested and verified locally.


framework/programs/run.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index 177bd53..508bc05 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -317,8 +317,9 @@ def run(input_):
                 'Unable to force a test list with more than one profile')
 
         with open(args.test_list) as test_list:
-            # Strip newlines
-            forced_test_list = [t.strip() for t in test_list]
+            # Strip newlines and comments, ignore empty lines
+            stripped = (t.split('#')[0].strip() for t in test_list)
+            forced_test_list = [t for t in stripped if t]
 
     backend = backends.get_backend(args.backend)(
         args.results_path,
-- 
2.9.3



More information about the Piglit mailing list