[Piglit] [Patch v2 1/2] exectest_test.py: Add test for PiglitTest.interpret_result() clobbering

Dylan Baker baker.dylan.c at gmail.com
Wed Jul 2 10:17:02 PDT 2014


This test demonstrates a bug in which PiglitTest clobbers subtest
results.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 framework/tests/exectest_test.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/framework/tests/exectest_test.py b/framework/tests/exectest_test.py
index b9ad0bf..d6d31af 100644
--- a/framework/tests/exectest_test.py
+++ b/framework/tests/exectest_test.py
@@ -20,6 +20,7 @@
 
 """ Tests for the exectest module """
 
+import nose.tools as nt
 from framework.exectest import PiglitTest, Test
 
 
@@ -75,3 +76,17 @@ def test_piglittest_interpret_result_subtest():
                           'PIGLIT: {"subtest": {"subtest": "pass"}}\n')
     test.interpret_result()
     assert test.result['subtest']['subtest'] == 'pass'
+
+
+def test_piglitest_no_clobber():
+    """ PiglitTest.interpret_result() does not clobber subtest entires """
+    test = PiglitTest(['a', 'command'])
+    test.result['out'] = (
+        'PIGLIT: {"result": "pass"}\n'
+        'PIGLIT: {"subtest": {"test1": "pass"}}\n'
+        'PIGLIT: {"subtest": {"test2": "pass"}}\n'
+    )
+    test.interpret_result()
+
+    nt.assert_dict_equal(test.result['subtest'],
+                         {'test1': 'pass', 'test2': 'pass'})
-- 
2.0.0



More information about the Piglit mailing list