commit d754608f55e0c4454f61c51f052159b038f17f8f Author: Oswald Buddenhagen <o...@users.sf.net> Date: Sun Mar 26 21:06:11 2017 +0200
autotest: improve valgrind integration introduce recognition of $USE_VALGRIND to run all mbsync invocations through valgrind. this also removes the seemingly purposeless --log-fd=3 indirection. src/run-tests.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/run-tests.pl b/src/run-tests.pl index 6515a50..6783db7 100755 --- a/src/run-tests.pl +++ b/src/run-tests.pl @@ -21,6 +21,7 @@ use strict; use Cwd; use File::Path; +my $use_vg = $ENV{USE_VALGRIND}; my $mbsync = getcwd()."/mbsync"; -d "tmp" or mkdir "tmp"; @@ -282,8 +283,14 @@ sub runsync($$) { my ($flags, $file) = @_; -# open FILE, "valgrind -q --log-fd=3 $mbsync $flags -c .mbsyncrc test 3>&2 2>&1 |"; - open FILE, "$mbsync -D -Z $flags -c .mbsyncrc test 2>&1 |"; + my $cmd; + if ($use_vg) { + $cmd = "valgrind -q --error-exitcode=1 "; + } else { + $flags .= " -D"; + } + $cmd .= "$mbsync -Z $flags -c .mbsyncrc test"; + open FILE, "$cmd 2>&1 |"; my @out = <FILE>; close FILE or push(@out, $! ? "*** error closing mbsync: $!\n" : "*** mbsync exited with signal ".($?&127).", code ".($?>>8)."\n"); if ($file) { ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ isync-devel mailing list isync-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/isync-devel