mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +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/mtr
|
||||||
mysql-test/mysql-test-run
|
mysql-test/mysql-test-run
|
||||||
mysql-test/var
|
mysql-test/var
|
||||||
|
mysql-test-gcov.err
|
||||||
|
mysql-test-gcov.msg
|
||||||
mysys/thr_lock
|
mysys/thr_lock
|
||||||
mysys/thr_timer
|
mysys/thr_timer
|
||||||
packaging/rpm-oel/mysql.spec
|
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
|
# 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.
|
# 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"
|
gcov_configs="--with-gcov"
|
||||||
|
|
||||||
|
@ -28,6 +28,6 @@ export LDFLAGS="$gcov_link_flags"
|
|||||||
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
|
extra_flags="$pentium64_cflags $max_cflags $gcov_compile_flags"
|
||||||
c_warnings="$c_warnings $debug_extra_warnings"
|
c_warnings="$c_warnings $debug_extra_warnings"
|
||||||
cxx_warnings="$cxx_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"
|
. "$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_interface.so
|
||||||
usr/lib/mysql/plugin/qa_auth_server.so
|
usr/lib/mysql/plugin/qa_auth_server.so
|
||||||
usr/share/mysql/mysql-test/README
|
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/README.stress
|
||||||
usr/share/mysql/mysql-test/disabled.def
|
usr/share/mysql/mysql-test/disabled.def
|
||||||
usr/share/mysql/mysql-test/lib
|
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:
|
do the following:
|
||||||
|
|
||||||
- Make sure gcov is installed
|
- 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
|
machine does not have a pentium CPU, hack this script, or just live with
|
||||||
the pentium-specific stuff)
|
the pentium-specific stuff)
|
||||||
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
|
- In the mysql-test directory, run this command: ./mysql-test-run -gcov
|
||||||
- To see the level of coverage for a given source file:
|
- 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
|
- 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
|
the source tree. You can find this by doing something like:
|
||||||
lines, and write one!
|
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";
|
print "Purging gcov information from '$dir'...\n";
|
||||||
|
|
||||||
system("find $dir -name \*.gcov -o -name \*.da"
|
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_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'};
|
||||||
|
|
||||||
our $opt_gcov;
|
our $opt_gcov;
|
||||||
our $opt_gcov_src_dir;
|
our $opt_gcov_src_dir=".";
|
||||||
our $opt_gcov_exe= "gcov";
|
our $opt_gcov_exe= "gcov";
|
||||||
our $opt_gcov_err= "mysql-test-gcov.err";
|
our $opt_gcov_err= "mysql-test-gcov.err";
|
||||||
our $opt_gcov_msg= "mysql-test-gcov.msg";
|
our $opt_gcov_msg= "mysql-test-gcov.msg";
|
||||||
|
Reference in New Issue
Block a user