[3/9] framework: add support for parsing subtest enumeration

Submitted by Dylan Baker on Jan. 20, 2018, 12:25 a.m.

Details

Message ID ae34165847a8d8346869600bc7bc63433e585c91.1516407949.git-series.dylan@pnwbakers.com
State New
Headers show
Series "Series without cover letter" ( rev: 13 12 11 10 9 8 7 6 5 4 3 2 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker Jan. 20, 2018, 12:25 a.m.
This adds support for enumerating subtests to the python layer. When it
sees this it sets each subtest to notrun. This allows the python
framework to report that tests didn't run when they were expected to.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
---
 framework/test/piglit_test.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/framework/test/piglit_test.py b/framework/test/piglit_test.py
index 491f3d3..a7406c1 100644
--- a/framework/test/piglit_test.py
+++ b/framework/test/piglit_test.py
@@ -34,6 +34,7 @@  except ImportError:
     import json
 
 from framework import core, options
+from framework import status
 from .base import Test, WindowResizeMixin, ValgrindMixin, TestIsSkip
 
 
@@ -73,7 +74,12 @@  class PiglitBaseTest(ValgrindMixin, Test):
 
         for each in self.result.out.split('\n'):
             if each.startswith('PIGLIT:'):
-                self.result.update(json.loads(each[8:]))
+                deserial = json.loads(each[8:])
+                if 'enumerate subtests' in deserial:
+                    self.result.subtests.update(
+                        {n: status.NOTRUN for n in deserial['enumerate subtests']})
+                else:
+                    self.result.update(deserial)
             else:
                 out.append(each)