mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / lib / v1 / mtr_gcov.pl
blob56942be72a8c99050994299fd26efb4591f83e83
1 # -*- cperl -*-
2 # Copyright (c) 2004, 2006 MySQL AB, 2008 Sun Microsystems, Inc.
3 # Use is subject to license terms.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 # This is a library file used by the Perl version of mysql-test-run,
19 # and is part of the translation of the Bourne shell script with the
20 # same name.
22 use strict;
24 # These are not to be prefixed with "mtr_"
26 sub gcov_prepare ();
27 sub gcov_collect ();
29 ##############################################################################
33 ##############################################################################
35 sub gcov_prepare () {
37 `find $::glob_basedir -name \*.gcov \
38 -or -name \*.da | xargs rm`;
41 # Used by gcov
42 our @mysqld_src_dirs=
44 "strings",
45 "mysys",
46 "include",
47 "extra",
48 "regex",
49 "isam",
50 "merge",
51 "myisam",
52 "myisammrg",
53 "heap",
54 "sql",
57 sub gcov_collect () {
59 print "Collecting source coverage info...\n";
60 -f $::opt_gcov_msg and unlink($::opt_gcov_msg);
61 -f $::opt_gcov_err and unlink($::opt_gcov_err);
62 foreach my $d ( @mysqld_src_dirs )
64 chdir("$::glob_basedir/$d");
65 foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
67 `$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`;
69 chdir($::glob_mysql_test_dir);
71 print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n";