mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixes for running with gcov
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -80,6 +80,8 @@ mysql-test/lib/My/SafeProcess/my_safe_process
|
||||
mysql-test/mtr
|
||||
mysql-test/mysql-test-run
|
||||
mysql-test/var
|
||||
mysql-test-gcov.err
|
||||
mysql-test-gcov.msg
|
||||
mysys/thr_lock
|
||||
mysys/thr_timer
|
||||
packaging/rpm-oel/mysql.spec
|
||||
|
@ -293,7 +293,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
|
||||
# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well
|
||||
# as on the compiler command line), and this requires setting LDFLAGS for BDB.
|
||||
|
||||
gcov_link_flags="-fprofile-arcs -ftest-coverage"
|
||||
gcov_link_flags="-fprofile-arcs -ftest-coverage -lgcov"
|
||||
|
||||
gcov_configs="--with-gcov"
|
||||
|
||||
|
@ -28,6 +28,6 @@ export LDFLAGS="$gcov_link_flags"
|
||||
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs --with-zlib-dir=bundled"
|
||||
extra_configs="$pentium_configs $debug_configs $gcov_configs $max_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
2
debian/mariadb-test.install
vendored
2
debian/mariadb-test.install
vendored
@ -17,7 +17,7 @@ usr/lib/mysql/plugin/qa_auth_client.so
|
||||
usr/lib/mysql/plugin/qa_auth_interface.so
|
||||
usr/lib/mysql/plugin/qa_auth_server.so
|
||||
usr/share/mysql/mysql-test/README
|
||||
usr/share/mysql/mysql-test/README.gcov
|
||||
usr/share/mysql/mysql-test/README-gcov
|
||||
usr/share/mysql/mysql-test/README.stress
|
||||
usr/share/mysql/mysql-test/disabled.def
|
||||
usr/share/mysql/mysql-test/lib
|
||||
|
@ -2,12 +2,14 @@ To be able to see the level of coverage with the current test suite,
|
||||
do the following:
|
||||
|
||||
- Make sure gcov is installed
|
||||
- Compile the MySQL distribution with BUILD/compile-pentium-gcov (if your
|
||||
- Compile the MySQL distribution with BUILD/compile-pentium64-gcov (if your
|
||||
machine does not have a pentium CPU, hack this script, or just live with
|
||||
the pentium-specific stuff)
|
||||
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
|
||||
- To see the level of coverage for a given source file:
|
||||
grep source_file_name /tmp/gcov.out
|
||||
grep -1 source_file_name ../mysql-test-gcov.msg
|
||||
- To see which lines are not yet covered, look at source_file_name.gcov in
|
||||
the source tree. Then think hard about a test case that will cover those
|
||||
lines, and write one!
|
||||
the source tree. You can find this by doing something like:
|
||||
find source-directory -name "mysqld.cc.gcov"
|
||||
Then think hard about a test case that will cover those lines, and write
|
||||
one!
|
@ -27,7 +27,7 @@ sub gcov_prepare ($) {
|
||||
print "Purging gcov information from '$dir'...\n";
|
||||
|
||||
system("find $dir -name \*.gcov -o -name \*.da"
|
||||
. " -o -name \*.gcda | grep -v 'README.gcov\$' | xargs rm");
|
||||
. " -o -name \*.gcda | xargs rm");
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -248,7 +248,7 @@ our $opt_mem= $ENV{'MTR_MEM'};
|
||||
our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
|
||||
|
||||
our $opt_gcov;
|
||||
our $opt_gcov_src_dir;
|
||||
our $opt_gcov_src_dir=".";
|
||||
our $opt_gcov_exe= "gcov";
|
||||
our $opt_gcov_err= "mysql-test-gcov.err";
|
||||
our $opt_gcov_msg= "mysql-test-gcov.msg";
|
||||
|
Reference in New Issue
Block a user