Commit 499a4416 authored by kent@mysql.com's avatar kent@mysql.com

compile-solaris-sparc-purify:

  Added preparation of mysql_client_test(_embedded) and mysqltest(_embedded)
  Added --purify, --purecov, --quantify and --cxxfilt <cxxfiltprog> options
mysql-test-run.sh:
  Report correctly combinations of embedded+ps-protocol etc
  Added initial Purify support
parent 42531336
#! /bin/sh #! /bin/sh
mode=""
cxxfilt=""
# For g++ 3.X, the PurifyPlus tools needs a program named "cxxfilt",
# "c++file" or similar. It is part of libtool. If not found, you can
# specify the path to it.
while test $# -gt 0 while test $# -gt 0
do do
case "$1" in case "$1" in
--debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;; --debug) EXTRA_CONFIG_FLAGS=--with-debug ;;
-h | --help ) cat <<EOF; exit 0 ;; --purify) mode=purify ;;
Usage: $0 [-h|-n] [configure-options] --purecov*) mode=purecov ;;
--debug Compile with DBUG enabled --quantify) mode=quantify ;;
--cxxfilt) shift ; cxxfilt=$1 ;;
-h | --help ) cat <<EOF; exit 0 ;;
Usage: $0 [ options ]
Where the 'options' are
--debug Compile with DBUG enabled
--purify Only prepare for Purify
--purecov Only prepare for PureCover
--quantify Only prepare for Quantify
--cxxfilt <cxxfilt> Path to cxxfilt/c++filt program
This program is needed for gcc 3.X
EOF EOF
*) echo "No such option '$1'" ; exit ;; *) echo "No such option '$1'" ; exit 1 ;;
esac esac
shift
done done
gmake -k clean || true gmake -k clean || true
...@@ -22,9 +42,70 @@ CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-sub ...@@ -22,9 +42,70 @@ CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-sub
gmake -j 4 gmake -j 4
cd sql ; mv mysqld mysqld-org ; # ----------------------------------------------------------------------
make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify
make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify #set -x
make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
mv mysqld-org mysqld purifying_binaries ()
{
while test $1
do
dir=$1
shift
target=$1
shift
binary=$1
shift
opts=""
if [ -n "$cxxfilt" ] ; then
opts="$opts -demangle-program=$cxxfilt"
fi
opts="$opts -best-effort g++"
back=`pwd`
cd $dir
# Because of libtool magic, the target and binary
# created might not be the same. To trigger rebuild,
# we need to move them both.
mv $binary $binary-old
if [ -f $target ] ; then
mv $target $target-old
fi
if [ -n "$mode" -a $mode = purify ] ; then
gmake CXXLD="purify $opts" $target
mv $binary $binary-purify
fi
if [ -n "$mode" -a $mode = quantify ] ; then
gmake CXXLD="quantify $opts" $target
mv $binary $binary-quantify
fi
if [ -n "$mode" -a $mode = purecov ] ; then
gmake CXXLD="purecov $opts" $target
mv $binary $binary-purecov
fi
mv $binary-old $binary
if [ -f $target-old ] ; then
mv $target-old $target
fi
cd $back
done
}
purifying_binaries \
sql mysqld mysqld \
client mysqltest .libs/mysqltest \
tests mysql_client_test mysql_client_test \
libmysqld/examples mysqltest_embedded mysqltest_embedded \
libmysqld/examples mysql_client_test_embedded mysql_client_test_embedded
# ----------------------------------------------------------------------
...@@ -220,6 +220,8 @@ EXTRA_MYSQLBINLOG_OPT="" ...@@ -220,6 +220,8 @@ EXTRA_MYSQLBINLOG_OPT=""
USE_RUNNING_SERVER="" USE_RUNNING_SERVER=""
USE_NDBCLUSTER="" USE_NDBCLUSTER=""
USE_RUNNING_NDBCLUSTER="" USE_RUNNING_NDBCLUSTER=""
USE_PURIFY=""
PURIFY_LOGS=""
DO_GCOV="" DO_GCOV=""
DO_GDB="" DO_GDB=""
MANUAL_GDB="" MANUAL_GDB=""
...@@ -239,7 +241,7 @@ MYSQL_TEST_SSL_OPTS="" ...@@ -239,7 +241,7 @@ MYSQL_TEST_SSL_OPTS=""
USE_TIMER="" USE_TIMER=""
USE_EMBEDDED_SERVER="" USE_EMBEDDED_SERVER=""
RESULT_EXT="" RESULT_EXT=""
TEST_MODE="default" TEST_MODE=""
NDB_MGM_EXTRA_OPTS= NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS=
...@@ -247,8 +249,17 @@ NDBD_EXTRA_OPTS= ...@@ -247,8 +249,17 @@ NDBD_EXTRA_OPTS=
while test $# -gt 0; do while test $# -gt 0; do
case "$1" in case "$1" in
--embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ --embedded-server)
USE_RUNNING_SERVER="" RESULT_EXT=".es" TEST_MODE="embedded" ;; USE_EMBEDDED_SERVER=1
USE_MANAGER=0 NO_SLAVE=1
USE_RUNNING_SERVER=""
RESULT_EXT=".es"
TEST_MODE="$TEST_MODE embedded" ;;
--purify)
USE_PURIFY=1
USE_MANAGER=0
USE_RUNNING_SERVER=""
TEST_MODE="$TEST_MODE purify" ;;
--user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
--force) FORCE=1 ;; --force) FORCE=1 ;;
--timer) USE_TIMER=1 ;; --timer) USE_TIMER=1 ;;
...@@ -334,7 +345,7 @@ while test $# -gt 0; do ...@@ -334,7 +345,7 @@ while test $# -gt 0; do
SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
;; ;;
--ps-protocol) --ps-protocol)
TEST_MODE="ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; TEST_MODE="$TEST_MODE ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
--user-test=*) --user-test=*)
USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
;; ;;
...@@ -444,6 +455,13 @@ while test $# -gt 0; do ...@@ -444,6 +455,13 @@ while test $# -gt 0; do
shift shift
done done
if [ -z "$TEST_MODE" ] ; then
TEST_MODE="default"
else
# Remove the leading space if any
TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'`
fi
#++ #++
# mysqld Environment Parameters # mysqld Environment Parameters
#-- #--
...@@ -505,7 +523,10 @@ if [ x$SOURCE_DIST = x1 ] ; then ...@@ -505,7 +523,10 @@ if [ x$SOURCE_DIST = x1 ] ; then
fi fi
MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded" MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded"
else else
MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" MYSQLD="$BASEDIR/sql/mysqld"
if [ -n "$VALGRIND" ] ; then
MYSQLD="$VALGRIND $MYSQLD"
fi
if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest" MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest"
elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then
...@@ -542,6 +563,31 @@ if [ x$SOURCE_DIST = x1 ] ; then ...@@ -542,6 +563,31 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
NDB_TOOLS_DIR="$BASEDIR/ndb/tools" NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm" NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
if [ -n "$USE_PURIFY" ] ; then
PSUP="$MYSQL_TEST_DIR/purify.suppress"
echo "suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm" > $PSUP
echo "suppress UMR my_end; main" >> $PSUP
echo "suppress UMR _doprnt; fprintf; my_end; main" >> $PSUP
PURIFYOPTIONS="-windows=no -log-file=%v.purifylog -append-logfile -add-suppression-files=$PSUP"
if [ -f "${MYSQL_TEST}-purify" ] ; then
MYSQL_TEST="${MYSQL_TEST}-purify"
PLOG="$MYSQL_TEST.purifylog"
if [ -f $PLOG ]; then
mv $PLOG $PLOG.$$
fi
PURIFY_LOGS="$PLOG"
fi
if [ -f "${MYSQLD}-purify" ] ; then
MYSQLD="${MYSQLD}-purify"
PLOG="$MYSQLD.purifylog"
if [ -f $PLOG ]; then
mv $PLOG $PLOG.$$
fi
PURIFY_LOGS="$PURIFY_LOGS $PLOG"
fi
fi
else else
# We have a binary installation. Note that this can be both from # We have a binary installation. Note that this can be both from
...@@ -558,6 +604,13 @@ else ...@@ -558,6 +604,13 @@ else
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
fi fi
CLIENT_BINDIR="$BASEDIR/bin" CLIENT_BINDIR="$BASEDIR/bin"
if test -d "$BASEDIR/tests"
then
TESTS_BINDIR="$BASEDIR/tests"
else
TESTS_BINDIR="$BASEDIR/bin"
fi
MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
...@@ -637,6 +690,7 @@ export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR ...@@ -637,6 +690,7 @@ export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
export NDB_TOOLS_DIR export NDB_TOOLS_DIR
export NDB_MGM export NDB_MGM
export NDB_BACKUP_DIR export NDB_BACKUP_DIR
export PURIFYOPTIONS
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
...@@ -753,6 +807,17 @@ skip_test() { ...@@ -753,6 +807,17 @@ skip_test() {
$ECHO "$RES$RES_SPACE [ skipped ]" $ECHO "$RES$RES_SPACE [ skipped ]"
} }
report_current_test () {
tname=$1
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
if [ -n "$PURIFY_LOGS" ] ; then
for log in $PURIFY_LOGS
do
echo "CURRENT_TEST: $tname" >> $log
done
fi
}
report_stats () { report_stats () {
if [ $TOT_FAIL = 0 ]; then if [ $TOT_FAIL = 0 ]; then
$ECHO "All $TOT_TEST tests were successful." $ECHO "All $TOT_TEST tests were successful."
...@@ -1487,7 +1552,7 @@ run_testcase () ...@@ -1487,7 +1552,7 @@ run_testcase ()
esac esac
stop_master stop_master
stop_master 1 stop_master 1
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR report_current_test $tname
start_master start_master
if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
start_master 1 start_master 1
...@@ -1503,13 +1568,13 @@ run_testcase () ...@@ -1503,13 +1568,13 @@ run_testcase ()
EXTRA_MASTER_OPT="" EXTRA_MASTER_OPT=""
stop_master stop_master
stop_master 1 stop_master 1
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR report_current_test $tname
start_master start_master
if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
start_master 1 start_master 1
fi fi
else else
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR report_current_test $tname
fi fi
fi fi
......
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