From: Ian Romanick <[email protected]>

It is very easy for the search to get stuck at a local minimum.  Thus
far that has not been an issue.  The resulting minimized test case is
generally small enough that it is easy to either perform additional
trimming by hand or find the root cause of the failure.

Signed-off-by: Ian Romanick <[email protected]>
---
 trim_shader.sh | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 trim_shader.sh

diff --git a/trim_shader.sh b/trim_shader.sh
new file mode 100644
index 0000000..d393a4f
--- /dev/null
+++ b/trim_shader.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+trimname=$(echo $1 | sed 's/shader_test/trim.shader_test/')
+workname=$(echo $1 | sed 's/shader_test/work.shader_test/')
+
+cp $1 $trimname
+
+typeset -i i
+i=0
+
+while true; do
+    if ! python2 generated_tests/random_ubo_trim.py $trimname $workname ; then
+       echo Test trimmer could not make progress.
+       break
+    fi
+
+
+    if mesa installed bin/shader_runner ./$workname -auto -fbo | grep -q pass; 
then
+       # If the test passes now, increment a counter.
+       echo No progress
+       i=$((i + 1))
+    else
+       # The test still fails.  The working file is now the minimal
+       # file.  Also, reset the counter.
+       mv $workname $trimname
+       i=0
+    fi
+
+    if [ $i -gt 100 ]; then
+       echo "100 attempts to trim failed.  Done"
+       break
+    fi
+done
-- 
1.8.1.4

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to