summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xmysql-test/dgcov.pl10
-rwxr-xr-xmysql-test/mysql-test-run.pl2
3 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4734c6f7d5f..d536027c88e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -256,7 +256,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
IF (ENABLE_GCOV)
- MY_CHECK_AND_SET_COMPILER_FLAG("-fprofile-arcs -ftest-coverage -lgcov" DEBUG)
+ MY_CHECK_AND_SET_COMPILER_FLAG("--coverage" DEBUG)
ENDIF()
MY_CHECK_AND_SET_COMPILER_FLAG(-ggdb3 DEBUG)
diff --git a/mysql-test/dgcov.pl b/mysql-test/dgcov.pl
index fbc5540e697..f2bbdad4d20 100755
--- a/mysql-test/dgcov.pl
+++ b/mysql-test/dgcov.pl
@@ -161,8 +161,14 @@ sub gcov_one_file {
system($cmd)==0 or die "system($cmd): $? $!";
}
- # now, read the generated file
- open FH, '<', "$_.gcov" or die "open(<$_.gcov): $!";
+ (my $filename = $_)=~ s/\.[^.]+$//; # remove extension
+ my $gcov_file_path= $File::Find::dir."/$filename.gcov";
+ if (! -f $gcov_file_path)
+ {
+ return;
+ }
+ open FH, '<', "$gcov_file_path" or die "open(<$gcov_file_path): $!";
+
my $fname;
while (<FH>) {
chomp;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 178d65aca41..be51a79e0be 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -1791,7 +1791,7 @@ sub command_line_setup {
# --------------------------------------------------------------------------
# Gcov flag
# --------------------------------------------------------------------------
- if ( ($opt_gcov or $opt_gprof) and ! $source_dist )
+ if ( ($opt_gcov or $opt_gprof) and (! $source_dist or -d $ENV{MTR_BINDIR}))
{
mtr_error("Coverage test needs the source - please use source dist");
}