mysql-test/mysql-test-run

    reversed gcov to work the old way - the worst thing that can happen 
    if slave and master execute the same code at the same time is that
    we get a lesser  count on the code branch execution, but in any case,
    it will be at least counted once, which is really all we care.
    
    Besides, the source tracking is most likely not thread safe, but this
    is ok for the same reason.
parent 2cd21162
...@@ -57,11 +57,8 @@ TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time" ...@@ -57,11 +57,8 @@ TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time"
DASHBLANK="---- ---- -------" DASHBLANK="---- ---- -------"
MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \ MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \
myisammrg heap sql" myisammrg heap sql"
GCOV_MASTER_MSG=/tmp/mysqld-master-gcov.out #gcov output GCOV_MSG=/tmp/mysqld-gcov.out #gcov output
GCOV_MASTER_ERR=/tmp/mysqld-master-gcov.err GCOV_ERR=/tmp/mysqld-gcov.err
GCOV_SLAVE_MSG=/tmp/mysqld-slave-gcov.out #gcov output
GCOV_SLAVE_ERR=/tmp/mysqld-slave-gcov.err
GCOV_SLAVE_SRC=/tmp/mysqld-slave-src/
[ -d $MY_TMP_DIR ] || mkdir -p $MY_TMP_DIR [ -d $MY_TMP_DIR ] || mkdir -p $MY_TMP_DIR
...@@ -130,6 +127,7 @@ else ...@@ -130,6 +127,7 @@ else
INSTALL_DB="../scripts/install_test_db -bin" INSTALL_DB="../scripts/install_test_db -bin"
fi fi
SLAVE_MYSQLD=$MYSQLD #this will be changed later if we are doing gcov
MYSQL_TEST="$MYSQL_TEST --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent" MYSQL_TEST="$MYSQL_TEST --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent"
...@@ -279,38 +277,21 @@ mysql_install_db () { ...@@ -279,38 +277,21 @@ mysql_install_db () {
gcov_prepare () { gcov_prepare () {
$FIND $BASEDIR -name \*.gcov \ $FIND $BASEDIR -name \*.gcov \
-or -name \*.da | $XARGS $RM -or -name \*.da | $XARGS $RM
$RM -rf $GCOV_SLAVE_SRC
for d in $MYSQLD_SRC_DIRS; do
cd $BASEDIR/$d
mkdir -p $GCOV_SLAVE_SRC/$d
for f in *.h *.cc *.c; do
cp $f $GCOV_SLAVE_SRC/$d
done
cd $MYSQL_TEST_DIR
done
} }
gcov_collect () { gcov_collect () {
$ECHO "Collecting source coverage info..." $ECHO "Collecting source coverage info..."
[ -f $GCOV_MASTER_MSG ] && $RM $GCOV_MASTER_MSG [ -f $GCOV_MSG ] && $RM $GCOV_MSG
[ -f $GCOV_MASTER_ERR ] && $RM $GCOV_MASTER_ERR [ -f $GCOV_ERR ] && $RM $GCOV_ERR
[ -f $GCOV_SLAVE_MSG ] && $RM $GCOV_SLAVE_MSG
[ -f $GCOV_SLAVE_ERR ] && $RM $GCOV_SLAVE_ERR
for d in $MYSQLD_SRC_DIRS; do for d in $MYSQLD_SRC_DIRS; do
cd $BASEDIR/$d cd $BASEDIR/$d
for f in *.h *.cc *.c; do for f in *.h *.cc *.c; do
$GCOV $f 2>>$GCOV_MASTER_ERR >>$GCOV_MASTER_MSG $GCOV $f 2>>$GCOV_ERR >>$GCOV_MSG
done
cd $MYSQL_TEST_DIR
cd $GCOV_SLAVE_SRC/$d
for f in *.h *.cc *.c; do
$GCOV $f 2>>$GCOV_SLAVE_ERR >>$GCOV_SLAVE_MSG
done done
cd $MYSQL_TEST_DIR cd $MYSQL_TEST_DIR
done done
$ECHO "gcov master info in $GCOV_MASTER_MSG, errors in $GCOV_MASTER_ERR" $ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
$ECHO "gcov slave info in $GCOV_SLAVE_MSG, errors in $GCOV_SLAVE_ERR"
} }
start_master() start_master()
...@@ -341,7 +322,6 @@ start_master() ...@@ -341,7 +322,6 @@ start_master()
start_slave() start_slave()
{ {
[ x$SKIP_SLAVE = x1 ] && return [ x$SKIP_SLAVE = x1 ] && return
[ -d $GCOV_SLAVE_SRC ] && cd $GCOV_SLAVE_SRC
slave_args="--no-defaults --server-id=2 \ slave_args="--no-defaults --server-id=2 \
--master-user=root \ --master-user=root \
--master-connect-retry=1 \ --master-connect-retry=1 \
...@@ -358,10 +338,10 @@ start_slave() ...@@ -358,10 +338,10 @@ start_slave()
if [ x$DO_GDB = x1 ] if [ x$DO_GDB = x1 ]
then then
echo "set args $slave_args" > $GDB_SLAVE_INIT echo "set args $slave_args" > $GDB_SLAVE_INIT
xterm -title "Slave" -e gdb -x $GDB_SLAVE_INIT $MYSQLD & xterm -title "Slave" -e gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD &
prompt_user "Hit enter to continue after you've started the slave" prompt_user "Hit enter to continue after you've started the slave"
else else
$MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 & $SLAVE_MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 &
fi fi
SLAVE_RUNNING=1 SLAVE_RUNNING=1
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment