From 635b2d7b767b52ee7878eba5353a1e3302df20af Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 29 Jan 2006 15:48:24 +0000 Subject: [PATCH] test for journalling and journal replay. --- src/run-tests.pl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/run-tests.pl b/src/run-tests.pl index 23041dc..5cc1938 100755 --- a/src/run-tests.pl +++ b/src/run-tests.pl @@ -259,10 +259,33 @@ Slave :slave: SyncState * ".shift(); close FILE; - open FILE, "../mbsync -D -c .mbsyncrc test 2>&1 |"; + open FILE, "../mbsync -D -J -c .mbsyncrc test 2>&1 |"; my @out = ; close FILE; + open(FILE, "<", "slave/.mbsyncstate") or + die "Cannot read old sync state.\n"; + my @oss = ; + close FILE; + open(FILE, "<", "slave/.mbsyncstate.journal") or + die "Cannot read journal.\n"; + my @nj = ; + close FILE; + open(FILE, "<", "slave/.mbsyncstate.new") or + die "Cannot read new sync state.\n"; + my @nss = ; + close FILE; + open FILE, "../mbsync -D -c .mbsyncrc --noop test 2>&1 |"; + my @jout = ; + close FILE; + open(FILE, "<", "slave/.mbsyncstate") or + die "Cannot read sync state.\n"; + my @jss = ; + close FILE; unlink ".mbsyncrc"; + if ("@nss" ne "@jss") { + print "Journalling error.\nOld State:\n".join("", @oss)."\nJournal:\n".join("", @nj)."\nNew State:\n".join("", @jss)."\nExpected New State:\n".join("", @nss)."\n"; + exit 1; + } return @out; }