diff options
Diffstat (limited to 'test-suite/compare_lnt_failures.sh')
-rwxr-xr-x | test-suite/compare_lnt_failures.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test-suite/compare_lnt_failures.sh b/test-suite/compare_lnt_failures.sh new file mode 100755 index 0000000..314fdd0 --- /dev/null +++ b/test-suite/compare_lnt_failures.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# This script helps comparing two outputs from a specific test failure +# It is a very specialised script and should be used with care. + +syntax="$0 test-dir out-file [skip-pattern]" +if [[ $1 = '' ]]; then + echo $syntax + exit 1 +fi +test_dir=$1 +if [[ $2 = '' ]]; then + echo $syntax + exit 1 +fi +out=$2 +echo "Differences for $test_dir" > $out +echo "LEFT is expected, RIGHT is achieved" >> $out +echo "" >> $out +skip='' +if [[ $3 != '' ]]; then + skip=$3 +fi + +failures=`grep "TEST-FAIL:" $test_dir/test.log | cut -d " " -f 3 | sort -u` +if [[ $failures = '' ]]; then + echo "No failures" + exit 0 +fi + +for f in $failures; do + if [[ $skip != '' && `echo $f | grep $skip` != '' ]]; then + echo "Skipping $f" >> $out + continue + fi + echo "Processing $f" >> $out + dir=`dirname $f` + file=`basename $f` + cd $dir/Output + diff $file.out-nat $file.out-simple >> $out +done |