]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
check-generated.sh: run on 'make check'
authorSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 00:13:19 +0000 (16:13 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Thu, 2 Feb 2012 00:13:19 +0000 (16:13 -0800)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/Makefile.am
src/test/encoding/check-generated.sh

index 76328e596776df46985e541cc0040697e324bd88..c530698b07cc7078c7e2d97fb6968f1953015155 100644 (file)
@@ -16,6 +16,9 @@ check_PROGRAMS =
 # target by target
 TESTS = $(check_PROGRAMS)
 
+check-local:
+       test/encoding/check-generated.sh
+
 EXTRALIBS = -luuid
 if FREEBSD
 EXTRALIBS += -lexecinfo
index 114e1c6ba20522c7571ca62c993aa01d93190c16..c0e542d91172833097cab5db4c3cfb283b4639ea 100755 (executable)
@@ -7,17 +7,25 @@ set -e
 tmp1=`mktemp /tmp/typ-XXXXXXXXX`
 tmp2=`mktemp /tmp/typ-XXXXXXXXX`
 
-echo "numgen\ttype"
+echo "checking ceph-dencoder generated test instances..."
+echo "numgen type"
 for type in `./ceph-dencoder list_types`; do
     num=`./ceph-dencoder type $type count_tests`
-    echo "$num\t$type"
+    echo "$num $type"
     for n in `seq 1 $num`; do
        ./ceph-dencoder type $type select_test $n dump_json > $tmp1
        ./ceph-dencoder type $type select_test $n encode decode dump_json > $tmp2
-       cmp $tmp1 $tmp2 || exit 1
+       if ! cmp $tmp1 $tmp2; then
+           echo "$type test $n json check failed"
+           exit 1
+       fi
 
        ./ceph-dencoder type $type select_test $n encode export $tmp1
        ./ceph-dencoder type $type select_test $n encode decode encode export $tmp2
-       cmp $tmp1 $tmp2 || exit 1
+       if ! cmp $tmp1 $tmp2; then
+           echo "$type test $n binary reencode check failed"
+           exit 1
+       fi
     done
-done
\ No newline at end of file
+done
+echo "ok."
\ No newline at end of file