autotest: de-duplicate error reporting paths

This commit is contained in:
Oswald Buddenhagen 2017-03-14 14:52:22 +01:00
parent 373abcef02
commit 2da7951fe0

View File

@ -616,24 +616,17 @@ sub test($$$@)
&writecfg(@sfx);
my ($xc, @ret) = runsync("-J");
if ($xc) {
print "Input:\n";
printchan($sx);
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ]\n";
print "Debug output:\n";
print @ret;
exit 1;
}
if (ckchan("slave/.mbsyncstate.new", $tx)) {
if ($xc || ckchan("slave/.mbsyncstate.new", $tx)) {
print "Input:\n";
printchan($sx);
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ]\n";
if (!$xc) {
print "Expected result:\n";
printchan($tx);
print "Actual result:\n";
showchan("slave/.mbsyncstate.new");
}
print "Debug output:\n";
print @ret;
exit 1;
@ -644,52 +637,35 @@ sub test($$$@)
my @nj = <FILE>;
close FILE;
($xc, @ret) = runsync("-0 --no-expunge");
if ($xc) {
print "Journal replay failed.\n";
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ], [ \"-0\", \"--no-expunge\" ]\n";
print "Old State:\n";
printstate(@{ $$sx[2] });
print "Journal:\n".join("", @nj)."\n";
print "Debug output:\n";
print @ret;
exit 1;
}
if (ckstate("slave/.mbsyncstate", @{ $$tx[2] })) {
if ($xc || ckstate("slave/.mbsyncstate", @{ $$tx[2] })) {
print "Journal replay failed.\n";
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ], [ \"-0\", \"--no-expunge\" ]\n";
print "Old State:\n";
printstate(@{ $$sx[2] });
print "Journal:\n".join("", @nj)."\n";
if (!$xc) {
print "Expected New State:\n";
printstate(@{ $$tx[2] });
print "New State:\n";
showstate("slave/.mbsyncstate");
}
print "Debug output:\n";
print @ret;
exit 1;
}
($xc, @ret) = runsync("");
if ($xc) {
print "Idempotence verification run failed.\n";
print "Input == Expected result:\n";
printchan($tx);
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ]\n";
print "Debug output:\n";
print @ret;
exit 1;
}
if (ckchan("slave/.mbsyncstate", $tx)) {
if ($xc || ckchan("slave/.mbsyncstate", $tx)) {
print "Idempotence verification run failed.\n";
print "Input == Expected result:\n";
printchan($tx);
print "Options:\n";
print " [ ".join(", ", map('"'.qm($_).'"', @sfx))." ]\n";
if (!$xc) {
print "Actual result:\n";
showchan("slave/.mbsyncstate");
}
print "Debug output:\n";
print @ret;
exit 1;