mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
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 mysql-test/mysql-test-run.sh: Report correctly combinations of embedded+ps-protocol etc Added initial Purify support BUILD/compile-solaris-sparc-purify: Added preparation of mysql_client_test(_embedded) and mysqltest(_embedded) Added --purify, --purecov, --quantify and --cxxfilt <cxxfiltprog> options
This commit is contained in:
parent
a271a6c878
commit
7e1bc3d3b5
2 changed files with 164 additions and 18 deletions
|
@ -1,15 +1,35 @@
|
|||
#! /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
|
||||
do
|
||||
case "$1" in
|
||||
--debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;;
|
||||
-h | --help ) cat <<EOF; exit 0 ;;
|
||||
Usage: $0 [-h|-n] [configure-options]
|
||||
--debug Compile with DBUG enabled
|
||||
--debug) EXTRA_CONFIG_FLAGS=--with-debug ;;
|
||||
--purify) mode=purify ;;
|
||||
--purecov*) mode=purecov ;;
|
||||
--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
|
||||
*) echo "No such option '$1'" ; exit ;;
|
||||
*) echo "No such option '$1'" ; exit 1 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
gmake -k clean || true
|
||||
|
@ -22,9 +42,70 @@ CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-sub
|
|||
|
||||
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
|
||||
make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov
|
||||
mv mysqld-org mysqld
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
#set -x
|
||||
|
||||
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=""
|
|||
USE_RUNNING_SERVER=""
|
||||
USE_NDBCLUSTER=""
|
||||
USE_RUNNING_NDBCLUSTER=""
|
||||
USE_PURIFY=""
|
||||
PURIFY_LOGS=""
|
||||
DO_GCOV=""
|
||||
DO_GDB=""
|
||||
MANUAL_GDB=""
|
||||
|
@ -239,7 +241,7 @@ MYSQL_TEST_SSL_OPTS=""
|
|||
USE_TIMER=""
|
||||
USE_EMBEDDED_SERVER=""
|
||||
RESULT_EXT=""
|
||||
TEST_MODE="default"
|
||||
TEST_MODE=""
|
||||
|
||||
NDB_MGM_EXTRA_OPTS=
|
||||
NDB_MGMD_EXTRA_OPTS=
|
||||
|
@ -247,8 +249,17 @@ NDBD_EXTRA_OPTS=
|
|||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \
|
||||
USE_RUNNING_SERVER="" RESULT_EXT=".es" TEST_MODE="embedded" ;;
|
||||
--embedded-server)
|
||||
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=;;"` ;;
|
||||
--force) FORCE=1 ;;
|
||||
--timer) USE_TIMER=1 ;;
|
||||
|
@ -334,7 +345,7 @@ while test $# -gt 0; do
|
|||
SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
|
||||
;;
|
||||
--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=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
|
||||
;;
|
||||
|
@ -444,6 +455,13 @@ while test $# -gt 0; do
|
|||
shift
|
||||
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
|
||||
#--
|
||||
|
@ -505,7 +523,10 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
fi
|
||||
MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded"
|
||||
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
|
||||
MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest"
|
||||
elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then
|
||||
|
@ -542,6 +563,31 @@ if [ x$SOURCE_DIST = x1 ] ; then
|
|||
MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
|
||||
NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
|
||||
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
|
||||
|
||||
# We have a binary installation. Note that this can be both from
|
||||
|
@ -558,6 +604,13 @@ else
|
|||
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
|
||||
fi
|
||||
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_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
|
||||
MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
|
||||
|
@ -637,6 +690,7 @@ export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
|
|||
export NDB_TOOLS_DIR
|
||||
export NDB_MGM
|
||||
export NDB_BACKUP_DIR
|
||||
export PURIFYOPTIONS
|
||||
|
||||
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
|
||||
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
|
||||
|
@ -753,6 +807,17 @@ skip_test() {
|
|||
$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 () {
|
||||
if [ $TOT_FAIL = 0 ]; then
|
||||
$ECHO "All $TOT_TEST tests were successful."
|
||||
|
@ -1487,7 +1552,7 @@ run_testcase ()
|
|||
esac
|
||||
stop_master
|
||||
stop_master 1
|
||||
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
|
||||
report_current_test $tname
|
||||
start_master
|
||||
if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
|
||||
start_master 1
|
||||
|
@ -1503,13 +1568,13 @@ run_testcase ()
|
|||
EXTRA_MASTER_OPT=""
|
||||
stop_master
|
||||
stop_master 1
|
||||
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
|
||||
report_current_test $tname
|
||||
start_master
|
||||
if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then
|
||||
start_master 1
|
||||
fi
|
||||
else
|
||||
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
|
||||
report_current_test $tname
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue