diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2014-09-24 09:38:17 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2014-10-08 11:12:32 +0200 |
commit | a04600a7ea84899f5110b5f8bca4a4531d498288 (patch) | |
tree | 9532c9dd802bfd66b9b395179fc299264e9a1ea8 | |
parent | ea1923b6191620ede39f90adb76292053d590921 (diff) |
Trim a failing test case to a (near) minimal reproducing caseubo-lolz
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.
v2: Remove some cruft specific to my environment.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r-- | trim_shader.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/trim_shader.sh b/trim_shader.sh new file mode 100644 index 000000000..84e903c16 --- /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 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 |