Skip to content

Commit 67034b6

Browse files
committed
Fixes for running with gcov
1 parent f27ca6f commit 67034b6

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ mysql-test/lib/My/SafeProcess/my_safe_process
8080
mysql-test/mtr
8181
mysql-test/mysql-test-run
8282
mysql-test/var
83+
mysql-test-gcov.err
84+
mysql-test-gcov.msg
8385
mysys/thr_lock
8486
mysys/thr_timer
8587
packaging/rpm-oel/mysql.spec

BUILD/SETUP.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
293293
# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
294294
# as on the compiler command line), and this requires setting LDFLAGS for BDB.
295295

296-
gcov_link_flags="-fprofile-arcs -ftest-coverage"
296+
gcov_link_flags="-fprofile-arcs -ftest-coverage -lgcov"
297297

298298
gcov_configs="--with-gcov"
299299

BUILD/compile-pentium64-gcov

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ export LDFLAGS="$gcov_link_flags"
2828
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
2929
c_warnings="$c_warnings $debug_extra_warnings"
3030
cxx_warnings="$cxx_warnings $debug_extra_warnings"
31-
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs --with-zlib-dir=bundled"
31+
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs"
3232

3333
. "$path/FINISH.sh"

debian/mariadb-test.install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ usr/lib/mysql/plugin/qa_auth_client.so
1717
usr/lib/mysql/plugin/qa_auth_interface.so
1818
usr/lib/mysql/plugin/qa_auth_server.so
1919
usr/share/mysql/mysql-test/README
20-
usr/share/mysql/mysql-test/README.gcov
20+
usr/share/mysql/mysql-test/README-gcov
2121
usr/share/mysql/mysql-test/README.stress
2222
usr/share/mysql/mysql-test/disabled.def
2323
usr/share/mysql/mysql-test/lib

mysql-test/README.gcov renamed to mysql-test/README-gcov

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ To be able to see the level of coverage with the current test suite,
22
do the following:
33

44
- Make sure gcov is installed
5-
- Compile the MySQL distribution with BUILD/compile-pentium-gcov (if your
5+
- Compile the MySQL distribution with BUILD/compile-pentium64-gcov (if your
66
machine does not have a pentium CPU, hack this script, or just live with
77
the pentium-specific stuff)
88
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
99
- To see the level of coverage for a given source file:
10-
grep source_file_name /tmp/gcov.out
10+
grep -1 source_file_name ../mysql-test-gcov.msg
1111
- To see which lines are not yet covered, look at source_file_name.gcov in
12-
the source tree. Then think hard about a test case that will cover those
13-
lines, and write one!
12+
the source tree. You can find this by doing something like:
13+
find source-directory -name "mysqld.cc.gcov"
14+
Then think hard about a test case that will cover those lines, and write
15+
one!

mysql-test/lib/mtr_gcov.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ($)
2727
print "Purging gcov information from '$dir'...\n";
2828

2929
system("find $dir -name \*.gcov -o -name \*.da"
30-
. " -o -name \*.gcda | grep -v 'README.gcov\$' | xargs rm");
30+
. " -o -name \*.gcda | xargs rm");
3131
}
3232

3333
#

mysql-test/mysql-test-run.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ END
248248
our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
249249

250250
our $opt_gcov;
251-
our $opt_gcov_src_dir;
251+
our $opt_gcov_src_dir=".";
252252
our $opt_gcov_exe= "gcov";
253253
our $opt_gcov_err= "mysql-test-gcov.err";
254254
our $opt_gcov_msg= "mysql-test-gcov.msg";

0 commit comments

Comments
 (0)