diff regression/regression-tests.bash @ 234:ed0cb66b23d4

better detection of dsn delivery reports
author Carl Byington <carl@five-ten-sg.com>
date Fri, 11 Sep 2009 12:46:36 -0700
parents 1d50ff3c5091
children 093e0e9248bb
line wrap: on
line diff
--- a/regression/regression-tests.bash	Thu Sep 10 22:49:24 2009 -0700
+++ b/regression/regression-tests.bash	Fri Sep 11 12:46:36 2009 -0700
@@ -21,10 +21,10 @@
     n="$1"
     fn="$2"
     echo $fn
+    ba=$(basename "$fn" .pst)
     rm -rf output$n
     mkdir output$n
-    $val ../src/pst2dii -f /usr/share/fonts/bitstream-vera/VeraMono.ttf -B "bates-" -o output$n -O mydii$n -d $fn.log $fn >$fn.dii.err 2>&1
-    rm -f dumper
+    $val ../src/pst2dii -f /usr/share/fonts/bitstream-vera/VeraMono.ttf -B "bates-" -o output$n -O $ba.mydii -d $fn.log $fn >$fn.dii.err 2>&1
 }
 
 
@@ -37,7 +37,6 @@
     rm -rf output$n
     mkdir output$n
     $val ../src/pst2ldif -d $ba.ldif.log -b 'o=ams-cc.com, c=US' -c 'inetOrgPerson' $fn >$ba.ldif.err 2>&1
-    rm -f dumper
 }
 
 
@@ -47,20 +46,23 @@
     fn="$2"
     echo $fn
     ba=$(basename "$fn" .pst)
-    jobs="-j 0"
-    [ -n "$val" ] && jobs="-j 0"
+    jobs=""
+    [ -n "$val" ]              && jobs="-j 0"
+    [ "$regression" == "yes" ] && jobs="-j 0"
     rm -rf output$n
     mkdir output$n
-    #val ../src/readpst $jobs -r -D -cv -o output$n            $fn
-    #$val ../src/readpst $jobs -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
-    $val ../src/readpst $jobs -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
-    #../src/getidblock -p $fn 0 >$ba.fulldump
+    if [ "$regression" == "yes" ]; then
+        $val ../src/readpst $jobs -te -r -D -cv -o output$n $fn >$ba.err 2>&1
+    else
+        #val ../src/readpst $jobs -r -D -cv -o output$n            $fn
+        $val ../src/readpst $jobs -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+        #$val ../src/readpst $jobs -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+        #../src/getidblock -p $fn 0 >$ba.fulldump
+    fi
 }
 
 
 
-val="valgrind --leak-check=full"
-val=''
 
 pushd ..
 make || exit
@@ -68,63 +70,49 @@
 
 rm -rf output* *.err *.log
 
-if [ "$1" == "test" ]; then
-    dopst  19 harris.pst
+func="dopst"
+[ "$1" == "pst"  ] && func="dopst"
+[ "$1" == "ldif" ] && func="doldif"
+[ "$1" == "dii"  ] && func="dodii"
 
-elif [ "$1" == "dii" ]; then
-    dodii 1 ams.pst
-    dodii 2 sample_64.pst
-    dodii 3 test.pst
-    dodii 4 big_mail.pst
+val="valgrind --leak-check=full"
+val=""
+
+regression=""
+[ "$2" == "reg" ] && regression="yes"
+[ "$regression" == "yes" ] && val=""
 
-elif [ "$1" == "ldif" ]; then
-    doldif   1 ams.pst
-    doldif   2 sample_64.pst
-    doldif   3 test.pst
-    doldif   4 big_mail.pst
-    doldif   5 mbmg.archive.pst
-    doldif   6 Single2003-read.pst
-    doldif   7 Single2003-unread.pst
-    doldif   8 ol2k3high.pst
-    doldif   9 ol97high.pst
-    doldif  10 returned_message.pst
-    doldif  11 flow.pst
-    doldif  12 test-html.pst
-    doldif  13 test-text.pst
-    doldif  14 joe.romanowski.pst
-    doldif  15 hourig1.pst
-    doldif  16 hourig2.pst
-    doldif  17 hourig3.pst
-    doldif  18 test-mac.pst
-    doldif  19 harris.pst
-    doldif  20 spam.pst
-    doldif  21 rendgen.pst
-else
-    dopst   1 ams.pst
-    dopst   2 sample_64.pst
-    dopst   3 test.pst
-    dopst   4 big_mail.pst
-    dopst   5 mbmg.archive.pst
-    dopst   6 Single2003-read.pst
-    dopst   7 Single2003-unread.pst
-    dopst   8 ol2k3high.pst
-    dopst   9 ol97high.pst
-    dopst  10 returned_message.pst
-    dopst  11 flow.pst
-    dopst  12 test-html.pst
-    dopst  13 test-text.pst
-    dopst  14 joe.romanowski.pst
-    dopst  15 hourig1.pst
-    #dopst  16 hourig2.pst
-    #dopst  17 hourig3.pst
-    dopst  18 test-mac.pst
-    dopst  19 harris.pst
-    dopst  20 spam.pst
-    dopst  21 rendgen.pst       # single email appointment
-    dopst  22 rendgen2.pst      # email appointment with no termination date
-    dopst  23 rendgen3.pst      # mime signed email
-    dopst  24 rendgen4.pst      # appointment test cases
-    dopst  25 rendgen5.pst      # appointment test cases
+$func   1 ams.pst
+$func   2 sample_64.pst
+$func   3 test.pst
+$func   4 big_mail.pst
+$func   5 mbmg.archive.pst
+$func   6 Single2003-read.pst
+$func   7 Single2003-unread.pst
+$func   8 ol2k3high.pst
+$func   9 ol97high.pst
+$func  10 returned_message.pst
+$func  11 flow.pst
+$func  12 test-html.pst
+$func  13 test-text.pst
+$func  14 joe.romanowski.pst
+$func  15 hourig1.pst
+$func  16 test-mac.pst
+$func  17 harris.pst
+$func  18 spam.pst
+$func  19 rendgen.pst       # single email appointment
+$func  20 rendgen2.pst      # email appointment with no termination date
+$func  21 rendgen3.pst      # mime signed email
+$func  22 rendgen4.pst      # appointment test cases
+$func  23 rendgen5.pst      # appointment test cases
+
+[ -n "$val" ] && grep 'lost:' *err | grep -v 'lost: 0 '
+
+if [ "$regression" == "yes" ]; then
+    (
+        (for i in output*; do find $i -type f; done) | while read a; do
+            grep -v iamunique "$a"
+            rm -f "$a"
+        done
+    ) >regression.txt
 fi
-
-grep 'lost:' *err | grep -v 'lost: 0 '