From 40b02446fb4c50a87b353a826fe1dbd20128617c Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 12 Nov 2012 21:02:47 +1100 Subject: [PATCH] allow supplying make options to imcover.perl and abort on make failure --- imcover.perl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/imcover.perl b/imcover.perl index 253122a3..6a05efb4 100644 --- a/imcover.perl +++ b/imcover.perl @@ -8,7 +8,9 @@ use Getopt::Long; my @tests; my $verbose; my $nodc; +my $make_opts = ""; GetOptions("t|test=s" => \@tests, + "m=s" => \$make_opts, "n" => \$nodc, "v" => \$verbose) or die; @@ -21,9 +23,9 @@ if (-f 'Makefile') { } run("cover -delete"); run("perl Makefile.PL --coverage @ARGV") - and die; -run("$make 'OTHERLDFLAGS=-ftest-coverage -fprofile-arcs'") - and die; + and die "Makefile.PL failed\n"; +run("$make $make_opts 'OTHERLDFLAGS=-ftest-coverage -fprofile-arcs'") + and die "build failed\n"; { local $ENV{DEVEL_COVER_OPTIONS} = "-db," . getcwd() . "/cover_db,-coverage,statement,branch,condition,subroutine"; @@ -32,7 +34,8 @@ run("$make 'OTHERLDFLAGS=-ftest-coverage -fprofile-arcs'") if (@tests) { $makecmd .= " TEST_FILES='@tests'"; } - run($makecmd); + run($makecmd) + and die "Test failed\n"; } # build gcov files -- 2.39.5