From 0a684bd933f2f088f46b2d207494c964e91e2702 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 3 Nov 2013 12:59:50 +0100 Subject: [PATCH] be a bit more verbose --- src/run-tests.pl | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/run-tests.pl b/src/run-tests.pl index ab6cc75..0ecfd8f 100755 --- a/src/run-tests.pl +++ b/src/run-tests.pl @@ -23,7 +23,7 @@ use File::Path; chdir "tmp" or die "Cannot enter temp direcory.\n"; sub show($$@); -sub test($$); +sub test($$$); ################################################################################ @@ -47,7 +47,7 @@ my @X01 = ( [ 9, 0, 9, 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 5, 5, "T", 6, 0, "", 7, 7, "FT", 0, 8, "", 10, 9, "", 9, 10, "" ], ); -test(\@x01, \@X01); +test("full", \@x01, \@X01); #show("01", "02", "", "", "Expunge Both\n"); my @X02 = ( @@ -59,7 +59,7 @@ my @X02 = ( [ 9, 0, 9, 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 10, 9, "", 9, 10, "" ], ); -test(\@x01, \@X02); +test("full + expunge both", \@x01, \@X02); #show("01", "03", "", "", "Expunge Slave\n"); my @X03 = ( @@ -71,7 +71,7 @@ my @X03 = ( [ 9, 0, 9, 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 5, 0, "T", 6, 0, "", 7, 0, "T", 10, 9, "", 9, 10, "" ], ); -test(\@x01, \@X03); +test("full + expunge slave", \@x01, \@X03); #show("01", "04", "", "", "Sync Pull\n"); my @X04 = ( @@ -83,7 +83,7 @@ my @X04 = ( [ 9, 0, 0, 1, 1, "F", 2, 2, "", 3, 3, "FS", 4, 4, "", 5, 5, "T", 6, 6, "", 7, 7, "FT", 0, 8, "", 9, 9, "" ], ); -test(\@x01, \@X04); +test("pull", \@x01, \@X04); #show("01", "05", "", "", "Sync Flags\n"); my @X05 = ( @@ -95,7 +95,7 @@ my @X05 = ( [ 8, 0, 0, 1, 1, "F", 2, 2, "F", 3, 3, "FS", 4, 4, "", 5, 5, "T", 6, 6, "", 7, 7, "FT", 8, 8, "" ], ); -test(\@x01, \@X05); +test("flags", \@x01, \@X05); #show("01", "06", "", "", "Sync Delete\n"); my @X06 = ( @@ -107,7 +107,7 @@ my @X06 = ( [ 8, 0, 0, 1, 1, "", 2, 2, "", 3, 3, "", 4, 4, "", 5, 5, "", 6, 0, "", 7, 7, "", 0, 8, "" ], ); -test(\@x01, \@X06); +test("deletions", \@x01, \@X06); #show("01", "07", "", "", "Sync New\n"); my @X07 = ( @@ -119,7 +119,7 @@ my @X07 = ( [ 9, 0, 9, 1, 1, "", 2, 2, "", 3, 3, "", 4, 4, "", 5, 5, "", 6, 6, "", 7, 7, "", 8, 8, "", 10, 9, "", 9, 10, "" ], ); -test(\@x01, \@X07); +test("new", \@x01, \@X07); #show("01", "08", "", "", "Sync PushFlags PullDelete\n"); my @X08 = ( @@ -131,7 +131,7 @@ my @X08 = ( [ 8, 0, 0, 1, 1, "", 2, 2, "F", 3, 3, "F", 4, 4, "", 5, 5, "", 6, 6, "", 7, 7, "", 0, 8, "" ], ); -test(\@x01, \@X08); +test("push flags + pull deletions", \@x01, \@X08); # size restriction tests @@ -154,12 +154,12 @@ my @X11 = ( [ 2, 0, 1, -1, 1, "", 1, 2, "", 2, -1, "" ], ); -test(\@x10, \@X11); +test("max size", \@x10, \@X11); my @x20 = @X11[1,2,3]; #show("20", "11", "MaxSize 1k\n", "MaxSize 1k\n", ""); # sic! - 11 -test(\@x20, \@X11); +test("max size verification", \@x20, \@X11); #show("20", "22", "", "MaxSize 1k\n", ""); my @X22 = ( @@ -171,7 +171,7 @@ my @X22 = ( [ 2, 0, 1, 3, 1, "", 1, 2, "", 2, -1, "" ], ); -test(\@x20, \@X22); +test("slave max size", \@x20, \@X22); # expiration tests @@ -194,7 +194,7 @@ my @X31 = ( [ 5, 0, 0, 1, 1, "F", 2, 2, "", 3, 3, "", 4, 4, "", 5, 5, "" ], ); -test(\@x30, \@X31); +test("max messages", \@x30, \@X31); my @x40 = @X31[1,2,3]; @@ -208,7 +208,7 @@ my @X41 = ( [ 5, 2, 0, 1, 1, "F", 3, 3, "", 4, 4, "", 5, 5, "" ], ); -test(\@x40, \@X41); +test("max messages catch-up", \@x40, \@X41); my @x50 = ( [ 5, @@ -229,7 +229,7 @@ my @X51 = ( [ 5, 2, 0, 2, 2, "F", 3, 3, "", 4, 4, "", 5, 5, "" ], ); -test(\@x50, \@X51); +test("max messages + expire", \@x50, \@X51); ################################################################################ @@ -581,10 +581,11 @@ sub printchan($$@) printstate(@t); } -sub test($$) +sub test($$$) { - my ($sx, $tx) = @_; + my ($ttl, $sx, $tx) = @_; + print "Testing: ".$ttl." ...\n"; mkchan($$sx[0], $$sx[1], @{ $$sx[2] }); &writecfg(@{ $$tx[0] }); my ($xc, @ret) = runsync("-J"); @@ -629,6 +630,7 @@ sub test($$) exit 1; } if (ckstate("slave/.mbsyncstate", @{ $$tx[3] })) { + print "Journal replay failed.\n"; print "Options:\n"; print " [ ".join(", ", map('"'.qm($_).'"', @{ $$tx[0] }))." ]\n"; print "Old State:\n";