From c161e5c9265bff2d8b8cb74545c2b81f43e686e2 Mon Sep 17 00:00:00 2001 From: Christoph Otto Date: Wed, 22 Dec 2010 12:47:32 -0800 Subject: [PATCH] make coverage tests fail quickly if Devel::Cover isn't installed --- config/auto/coverage.pm | 7 ++++++- config/gen/makefiles/root.in | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/auto/coverage.pm b/config/auto/coverage.pm index 8c99f3d31f..90b9e319ce 100644 --- a/config/auto/coverage.pm +++ b/config/auto/coverage.pm @@ -43,6 +43,7 @@ sub runstep { my ( $self, $conf ) = @_; my %utils_needed = map { $_ => undef } qw( gcov gcov2perl cover ); + my @utils_lacking; foreach my $util (keys %utils_needed) { my $which_util = which($util); if ($which_util) { @@ -50,10 +51,13 @@ sub runstep { } else { $utils_needed{$util} = "echo '$util needed but not found' && exit 1"; + push @utils_lacking, $util; } } - my @utils_lacking = grep { ! defined $utils_needed{$_} } keys %utils_needed; if (@utils_lacking) { + $utils_needed{'have_cover'} = + 'echo "The following tools are needed for coverage testing: '.join(', ',@utils_lacking). + '"; echo "Please install Devel::Cover."; exit 1'; $self->set_result("lacking @utils_lacking"); $conf->data->set( "has_coverage_tools" => 0, @@ -61,6 +65,7 @@ sub runstep { ); } else { + $utils_needed{'have_cover'} = 'exit 0'; $conf->data->set( "has_coverage_tools" => 1, %utils_needed, diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in index c7f776a29b..3e14b2b2c3 100644 --- a/config/gen/makefiles/root.in +++ b/config/gen/makefiles/root.in @@ -2561,6 +2561,7 @@ QUICKCOVER_DIRS = \ frontend/pbc_merge \ compilers/imcc +HAVE_COVER = @have_cover@ COVER = @cover@ GCOV = @gcov@ GCOV2PERL = @gcov2perl@ @@ -2580,6 +2581,7 @@ quickcover: \ $(COVER) $(COVERAGE_DIR) -ignore_re '^\/usr\/local\/bin' cover.dummy: + $(HAVE_COVER) \ $(PERL) Configure.pl --ccflags="$(CC_FLAGS) $(COVER_FLAGS)" \ --linkflags="$(COVER_FLAGS)" --ldflags="$(COVER_FLAGS)"