diff options
author | Monty <monty@mariadb.org> | 2016-12-06 14:05:09 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-01-11 09:18:35 +0200 |
commit | 67034b6d5265621d67ce589cdee537571ccacfa9 (patch) | |
tree | fb719320258339256ae34c0530dcd545b3bf5d57 | |
parent | f27ca6f667f21b45325cc0f262f6aa632375be9a (diff) | |
download | mariadb-git-67034b6d5265621d67ce589cdee537571ccacfa9.tar.gz |
Fixes for running with gcov
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | BUILD/SETUP.sh | 2 | ||||
-rwxr-xr-x | BUILD/compile-pentium64-gcov | 2 | ||||
-rw-r--r-- | debian/mariadb-test.install | 2 | ||||
-rw-r--r-- | mysql-test/README-gcov (renamed from mysql-test/README.gcov) | 10 | ||||
-rw-r--r-- | mysql-test/lib/mtr_gcov.pl | 2 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 2 |
7 files changed, 13 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore index dce5b5ea934..3cec6585ca8 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 01d654dba53..5f5b0250088 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -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" diff --git a/BUILD/compile-pentium64-gcov b/BUILD/compile-pentium64-gcov index 36d4b6192ec..9587c51b4e0 100755 --- a/BUILD/compile-pentium64-gcov +++ b/BUILD/compile-pentium64-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" diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index 5e6c3717d1f..605620dc28c 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -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 diff --git a/mysql-test/README.gcov b/mysql-test/README-gcov index 6d2852e8ca0..ba22a796423 100644 --- a/mysql-test/README.gcov +++ b/mysql-test/README-gcov @@ -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! diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl index a6e1f8efd5f..4c260d089b2 100644 --- a/mysql-test/lib/mtr_gcov.pl +++ b/mysql-test/lib/mtr_gcov.pl @@ -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"); } # diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 58aedf169d8..9efc9035555 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -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"; |