]> granicus.if.org Git - re2c/commitdiff
- Use diff for comparing and add .diff to ignore list
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 30 Dec 2005 18:28:00 +0000 (18:28 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Fri, 30 Dec 2005 18:28:00 +0000 (18:28 +0000)
run_tests.sh.in
test/.cvsignore

index df5aa192f42abf34dd1509d4ce9d07670be15ced..37057af00fde80d8213e08e827d6fc0ad341238b 100644 (file)
@@ -6,8 +6,9 @@ for x in @top_srcdir@/test/*.re; do
        switches=`basename $x|sed -e 's/^.*\.\([^.]*\)\..*$/-\1/g' -e 's/^[^-].*//'g`
        # don't use the -o flag, since it makes it harder to diff.
        outname=@builddir@/test/`basename ${x%.re}.temp`
+       difname=@builddir@/test/`basename ${x%.re}.diff`
        @builddir@/re2c $switches $x 2>&1 | sed -e "s,$x,`basename $x`,g" -e "s,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g" > $outname
-       if cmp -s ${x%.re}.c $outname; then
+       if diff -u ${x%.re}.c $outname > $difname; then
                echo "Passed."
                rm $outname
        else
@@ -15,6 +16,7 @@ for x in @top_srcdir@/test/*.re; do
                result=1
                errcnt=$(($errcnt+1))
        fi
+       test -f ${x%.re}.diff -a ! -s $difname && rm -f $difname
 done
 if test $result = 0; then
        echo "All tests passed successfully."
index b498376a98dd76151f73057a12b8a91b02f2f333..a0206597e80e15bd2fe47f3d40bd0acc99c9b302 100644 (file)
@@ -1,2 +1,3 @@
 a.out
 *.temp
+*.diff