diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/run-tests.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/run-tests.sh b/tests/run-tests.sh index a508755..3ab4fe1 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -1,5 +1,16 @@ #!/bin/sh source ${builddir:-.}/slapd.sh +probably= +compare() +{ + probably= + if ! cmp -s "$@" ; then + if diff -u -i "$@" > /dev/null 2> /dev/null ; then + probably="(probably)" + fi + fi + diff -u -i "$@" > /dev/null 2> /dev/null +} showdiff() { base1=`basename "$1"` @@ -37,7 +48,7 @@ for subdir in "$@" ; do sleep 5 $TESTDIR/$subdir/before.sh > before.out 2>&1 if test -r $TESTDIR/$subdir/before.txt ; then - if ! cmp -s $TESTDIR/$subdir/before.txt before.out ; then + if ! compare $TESTDIR/$subdir/before.txt before.out ; then echo `basename "$subdir"`: showdiff $TESTDIR/$subdir/before.txt before.out stopslapd @@ -48,7 +59,7 @@ for subdir in "$@" ; do if test -x $TESTDIR/$subdir/change.sh ; then $TESTDIR/$subdir/change.sh > change.out 2>&1 if test -r $TESTDIR/$subdir/change.txt ; then - if ! cmp -s $TESTDIR/$subdir/change.txt change.out ; then + if ! compare $TESTDIR/$subdir/change.txt change.out ; then echo `basename "$subdir"`: showdiff $TESTDIR/$subdir/change.txt change.out stopslapd @@ -60,7 +71,7 @@ for subdir in "$@" ; do sleep 5 $TESTDIR/$subdir/after.sh > after.out 2>&1 if test -r $TESTDIR/$subdir/after.txt ; then - if ! cmp -s $TESTDIR/$subdir/after.txt after.out ; then + if ! compare $TESTDIR/$subdir/after.txt after.out ; then echo `basename "$subdir"`: showdiff $TESTDIR/$subdir/after.txt after.out stopslapd @@ -83,9 +94,9 @@ for subdir in "$@" ; do stopslapd popd > /dev/null if test -s $TESTDIR/$subdir/description.txt ; then - echo `basename $subdir`" ("`head -n 1 $TESTDIR/$subdir/description.txt`")": OK + echo `basename $subdir`" ("`head -n 1 $TESTDIR/$subdir/description.txt`")": $probably OK else - echo `basename $subdir`: OK + echo `basename $subdir`: $probably OK fi done exit 0 |