run.test mysql-test -> mysqltest

run-all-tests	mysql-test -> mysqltest
README  	mysql-test -> mysqltest
Makefile.am	Retargetted mysql-test to mysqltest.
.del-mysql-test.c	Delete: client/mysql-test.c
mysql-test-run	Added program definitions.
mysqltest.c	BitKeeper file /home/mwagner/work/bk/mysql/client/mysqltest.c
parent 45adf2a8
......@@ -21,8 +21,8 @@ INCLUDES = -I$(srcdir)/../include \
-I..
LIBS = @CLIENT_LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la
bin_PROGRAMS = mysql mysqladmin mysqlshow mysqldump mysqlimport
noinst_PROGRAMS = insert_test select_test thread_test mysql-test
bin_PROGRAMS = mysql mysqladmin mysqlshow mysqldump mysqlimport mysqltest
noinst_PROGRAMS = insert_test select_test thread_test
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
......@@ -33,8 +33,8 @@ mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysql_test_SOURCES= mysql-test.c
mysql_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysqltest_SOURCES= mysqltest.c
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
# Fix for mit-threads
DEFS = -DUNDEF_THREADS_HACK
......
This diff is collapsed.
......@@ -17,6 +17,7 @@ cd $CWD
MYBIN="$CWD/mybin"
TESTVER=3.23
TESTDIR="$CWD/t/$TESTVER"
TESTSUFFIX=test
TOT_PASS=0
TOT_FAIL=0
TOT_TEST=0
......@@ -46,9 +47,12 @@ MYERR="$CWD/var/log/mysqld.err"
#++
# Program Definitions
#--
ECHO=/bin/echo
EXPR=/usr/bin/expr
PRINTF=/usr/bin/printf
TIME=/usr/bin/time
MYSQLD="$BASEDIR/sql/mysqld"
MYSQL_TEST="$BASEDIR/client/mysql-test"
MYSQL_TEST="$BASEDIR/client/mysqltest"
MYSQLADMIN="$BASEDIR/client/mysqladmin"
MYSQL_TEST="$MYSQL_TEST --socket=$MYSOCK --database=$DB --user=$USER --password=$PASSWD --silent"
INSTALL_DB="$MYBIN/mysql-test_install_db"
......@@ -57,11 +61,11 @@ INSTALL_DB="$MYBIN/mysql-test_install_db"
#++
# Terminal Modifications
#--
MOVE_TO_COL="echo -en \\033[300C\\033[20D"
SETCOLOR_SUCCESS="echo -en \\033[1;32m"
SETCOLOR_FAILURE="echo -en \\033[1;31m"
SETCOLOR_WARNING="echo -en \\033[1;33m"
SETCOLOR_NORMAL="echo -en \\033[0;39m"
MOVE_TO_COL="$ECHO -en \\033[300C\\033[20D"
SETCOLOR_SUCCESS="$ECHO -en \\033[1;32m"
SETCOLOR_FAILURE="$ECHO -en \\033[1;31m"
SETCOLOR_WARNING="$ECHO -en \\033[1;33m"
SETCOLOR_NORMAL="$ECHO -en \\033[0;39m"
......@@ -70,78 +74,78 @@ SETCOLOR_NORMAL="echo -en \\033[0;39m"
#--
echo_ok() {
$MOVE_TO_COL && $SETCOLOR_NORMAL
echo -n "[ "
$ECHO -n "[ "
$SETCOLOR_SUCCESS
echo -n "ok"
$ECHO -n "ok"
$SETCOLOR_NORMAL
echo " ]"
$ECHO " ]"
return 0
}
echo_notok() {
$MOVE_TO_COL && $SETCOLOR_NORMAL
echo -n "[ "
$ECHO -n "[ "
$SETCOLOR_FAILURE
echo -n "not ok"
$ECHO -n "not ok"
$SETCOLOR_NORMAL
echo " ]"
$ECHO " ]"
return 0
}
echo_pass () {
$MOVE_TO_COL && $SETCOLOR_NORMAL
echo -n "[ "
$ECHO -n "[ "
$SETCOLOR_SUCCESS
echo -n "pass"
$ECHO -n "pass"
$SETCOLOR_NORMAL
echo " ]"
$ECHO " ]"
return 0
}
echo_fail () {
$MOVE_TO_COL && $SETCOLOR_NORMAL
echo -n "[ "
$ECHO -n "[ "
$SETCOLOR_FAILURE
echo -n "fail"
$ECHO -n "fail"
$SETCOLOR_NORMAL
echo " ]"
$ECHO " ]"
return 0
}
error () {
$SETCOLOR_FAILURE
echo -n "Error: " && $SETCOLOR_NORMAL && echo $1
$ECHO -n "Error: " && $SETCOLOR_NORMAL && $ECHO $1
$SETCOLOR_NORMAL
exit 1
}
pass_inc () {
TOT_PASS=`expr $TOT_PASS + 1`
TOT_PASS=`$EXPR $TOT_PASS + 1`
}
fail_inc () {
TOT_FAIL=`expr $TOT_FAIL + 1`
TOT_FAIL=`$EXPR $TOT_FAIL + 1`
}
total_inc () {
TOT_TEST=`expr $TOT_TEST + 1`
TOT_TEST=`$EXPR $TOT_TEST + 1`
}
report_stats () {
if [ $TOT_FAIL = 0 ]; then
echo "All tests successful."
$ECHO "All tests successful."
else
echo -n "Failed ${TOT_FAIL}/${TOT_TEST} tests, "
$ECHO -n "Failed ${TOT_FAIL}/${TOT_TEST} tests, "
xten=`expr $TOT_PASS \* 10000` #
raw=`expr $xten / $TOT_TEST` # My God
raw=`printf %.4d $raw` # This is such a ...
whole=`printf %.2s $raw` # Narttu!!
xwhole=`expr $whole \* 100` # Hynda!!!
deci=`expr $raw - $xwhole` #
xten=`$EXPR $TOT_PASS \* 10000` #
raw=`$EXPR $xten / $TOT_TEST` # My God
raw=`$PRINTF %.4d $raw` # This is such a ...
whole=`$PRINTF %.2s $raw` # Narttu!!
xwhole=`$EXPR $whole \* 100` # Hynda!!!
deci=`$EXPR $raw - $xwhole` #
echo "${whole}.${deci}% successful."
$ECHO "${whole}.${deci}% successful."
fi
}
......@@ -197,27 +201,27 @@ mysql_loadstd () {
mysql_install_db
$SETCOLOR_NORMAL && echo -n "Starting mysqld for Testing"
$SETCOLOR_NORMAL && $ECHO -n "Starting mysqld for Testing"
mysql_start
res=$?
res=1
[ $res != 1 ] && echo_notok && error "Starting mysqld"
[ $res = 1 ] && echo_ok
$SETCOLOR_NORMAL && echo -n "Loading Standard Test Database"
$SETCOLOR_NORMAL && $ECHO -n "Loading Standard Test Database"
mysql_loadstd
res=$?
[ $res != 1 ] && echo_notok && error "Loading STD"
[ $res = 1 ] && echo_ok
$SETCOLOR_NORMAL && echo -n "Starting Tests for MySQL $TESTVER Series"
$SETCOLOR_NORMAL && $ECHO -n "Starting Tests for MySQL $TESTVER Series"
$SETCOLOR_SUCCESS && echo_ok
echo
echo -e " TEST\t\t\tUSER\tSYSTEM\tELAPSED\t%CPU\t RESULT"
echo $DASH72
$ECHO
$ECHO -e " TEST\t\t\tUSER\tSYSTEM\tELAPSED\t%CPU\t RESULT"
$ECHO $DASH72
for tf in $TESTDIR/*.test
for tf in $TESTDIR/*.$TESTSUFFIX
do
if [ -f $tf ] ; then
mytime=`$TIME -f $TIME_FORMAT $MYSQL_TEST < $tf 2>&1`
......@@ -225,31 +229,31 @@ do
tf=`basename $tf`
[ $res = 1 ] && mytime=`echo -ne $mytime | cut -b 39-`
$SETCOLOR_NORMAL && echo -ne "$tf\t$mytime"
[ $res = 1 ] && mytime=`$ECHO -ne $mytime | cut -b 39-`
$SETCOLOR_NORMAL && $ECHO -ne "$tf\t$mytime"
[ $res = 1 ] && fail_inc && echo_fail
[ $res != 1 ] && pass_inc && echo_pass
total_inc
if [ $res != 0 ]; then
echo
$SETCOLOR_NORMAL && echo -ne "Restarting mysqld\t$DASHBLANK"
$ECHO
$SETCOLOR_NORMAL && $ECHO -ne "Restarting mysqld\t$DASHBLANK"
mysql_restart
$SETCOLOR_SUCCESS && echo_ok
$SETCOLOR_NORMAL && echo -ne "Resuming Tests\t\t$DASHBLANK"
$SETCOLOR_NORMAL && $ECHO -ne "Resuming Tests\t\t$DASHBLANK"
$SETCOLOR_SUCCESS && echo_ok
echo
$ECHO
fi
fi
done
echo $DASH72
echo
$SETCOLOR_NORMAL && echo -n "Ending Tests for MySQL $TESTVER Series"
$ECHO $DASH72
$ECHO
$SETCOLOR_NORMAL && $ECHO -n "Ending Tests for MySQL $TESTVER Series"
$SETCOLOR_SUCCESS && echo_ok
$SETCOLOR_NORMAL && echo -n "Shutdown mysqld"
$SETCOLOR_NORMAL && $ECHO -n "Shutdown mysqld"
mysql_stop
res=$?
res=1
......@@ -258,8 +262,8 @@ res=1
$SETCOLOR_NORMAL
echo
$ECHO
report_stats
echo
$ECHO
exit 0
......@@ -9,4 +9,4 @@ sh run-all-tests
If you would like to add your own test case, create a directory
test-your-test-case-name, write your own run.test following the examples
in the other test cases. Note that you can create the files containing
the expected output ( master files) by running mysql-test --record < run.test
\ No newline at end of file
the expected output ( master files) by running mysqltest --record < run.test
\ No newline at end of file
......@@ -4,6 +4,6 @@ for d in test-*; do
cd $d
echo -n $d | sed -e s/test-//
echo -n "...."
../../client/mysql-test $@ < run.test
../../client/mysqltest $@ < run.test
cd ..
done
\ No newline at end of file
#! ../client/mysql-test
#! ../client/mysqltest
# tests if the replicaion preserves timestamp properly
source ../include/master-slave.inc;
......
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