Commit c38d96d9 authored by unknown's avatar unknown

mysql-test-run Code clean-ups.


mysql-test/mysql-test-run:
  Code clean-ups.
parent 658bfc4c
...@@ -29,7 +29,6 @@ TIMEFILE="$CWD/var/tmp/mysqltest-time" ...@@ -29,7 +29,6 @@ TIMEFILE="$CWD/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=`which gcov`
GCOV_MSG=/tmp/mysqld-gcov.out #gcov output GCOV_MSG=/tmp/mysqld-gcov.out #gcov output
GCOV_ERR=/tmp/mysqld-gcov.err GCOV_ERR=/tmp/mysqld-gcov.err
...@@ -61,16 +60,21 @@ CAT=/bin/cat ...@@ -61,16 +60,21 @@ CAT=/bin/cat
CUT=/usr/bin/cut CUT=/usr/bin/cut
ECHO=/bin/echo ECHO=/bin/echo
EXPR=`which expr` EXPR=`which expr`
FIND=/usr/bin/find
GCOV=`which gcov`
PRINTF=/usr/bin/printf PRINTF=/usr/bin/printf
RM=/bin/rm RM=/bin/rm
TIME=/usr/bin/time TIME=/usr/bin/time
TR=/usr/bin/tr TR=/usr/bin/tr
XARGS=`which xargs`
MYSQLD="$BASEDIR/sql/mysqld" MYSQLD="$BASEDIR/sql/mysqld"
MYSQL_TEST="$BASEDIR/client/mysqltest" MYSQL_TEST="$BASEDIR/client/mysqltest"
MYSQLADMIN="$BASEDIR/client/mysqladmin" MYSQLADMIN="$BASEDIR/client/mysqladmin"
MYSQL_TEST="$MYSQL_TEST --socket=$MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent" MYSQL_TEST="$MYSQL_TEST --socket=$MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent"
INSTALL_DB="$MYBIN/mysql-test_install_db" INSTALL_DB="$MYBIN/mysql-test_install_db"
[ "$1" = "-gcov" ] && DO_GCOV=1 [ "$1" = "-gcov" ] && DO_GCOV=1
#++ #++
# Terminal Modifications # Terminal Modifications
#-- #--
...@@ -163,35 +167,35 @@ report_stats () { ...@@ -163,35 +167,35 @@ report_stats () {
mysql_install_db () { mysql_install_db () {
`$INSTALL_DB` `$INSTALL_DB`
if [ $? != 0 ]; then if [ $? != 0 ]; then
error "Could not install tmp DBs" error "Could not install test DBs"
exit 1 exit 1
fi fi
return 0 return 0
} }
gcov_clean () { gcov_clean () {
find .. -name -name \*.gcov \ $FIND $BASEDIR -name \*.gcov \
-or -name \*.da | xargs rm -or -name \*.da | $XARGS $RM
} }
gcov_collect () { gcov_collect () {
echo "Collecting source coverage info..." $ECHO "Collecting source coverage info..."
[ -f $GCOV_MSG ] && rm $GCOV_MSG [ -f $GCOV_MSG ] && $RM $GCOV_MSG
[ -f $GCOV_ERR ] && rm $GCOV_ERR [ -f $GCOV_ERR ] && $RM $GCOV_ERR
for d in $MYSQLD_SRC_DIRS; do for d in $MYSQLD_SRC_DIRS; do
cd ../$d cd $BASEDIR/$d
for f in *.h *.cc *.c; do for f in *.h *.cc *.c; do
$GCOV $f 2>>$GCOV_ERR >>$GCOV_MSG $GCOV $f 2>>$GCOV_ERR >>$GCOV_MSG
done
cd $CWD
done done
cd ../mysql-test
done
echo "gcov info in $GCOV_MSG, errors in $GCOV_ERR" $ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
} }
mysql_start () { mysql_start () {
cd .. # for gcov cd $BASEDIR # for gcov
$MYSQLD --no-defaults \ $MYSQLD --no-defaults \
--skip-networking \ --skip-networking \
--basedir=$CWD \ --basedir=$CWD \
...@@ -200,7 +204,7 @@ mysql_start () { ...@@ -200,7 +204,7 @@ mysql_start () {
--socket=$MYSOCK \ --socket=$MYSOCK \
--log=$MYLOG \ --log=$MYLOG \
--language=english >> $MYERR 2>&1 & --language=english >> $MYERR 2>&1 &
cd mysql-test cd $CWD
return 1 return 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