[4/4] tests/quick_shader.py: Fix test count of quick_shader

Submitted by Dylan Baker on May 8, 2018, 9:22 p.m.


Message ID 20180508212207.13889-4-dylan@pnwbakers.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Dylan Baker May 8, 2018, 9:22 p.m.
This filter hasn't worked quite right since the XML profile conversion,
the reason is that the assumption all filters had before the conversion
was that they would be used once, which is no longer true. They'll be
run at least twice now, once to get the count of tests, and once to
run the tests.

With the addition of the reset() method to the filter protocol, and the
Filter class that calls it, we can set the seed in the random generator
back to 42 (an arbitrary starting value), before it's run. This ensures
that the generation of the count and running of the actual tests match.
 tests/quick_shader.py | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/quick_shader.py b/tests/quick_shader.py
index c1b1d7938..f1bda6545 100644
--- a/tests/quick_shader.py
+++ b/tests/quick_shader.py
@@ -46,6 +46,9 @@  class FilterVsIn(object):
             return self.random.random() <= .2
         return True
+    def reset(self):
+        self.random.seed(42)