2000-11-25 03:49:13 +01:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# This script is a hack for lazy developers who want to get a quick
|
|
|
|
# start on the result file. The code here is rather dirty, but it works
|
|
|
|
# If you have a spare moment feel free to improve it - the right way is
|
|
|
|
# to start mysqld yourself and run mysqltest -r
|
|
|
|
|
2001-12-14 15:02:41 +01:00
|
|
|
RESULT_DIR=r
|
2004-08-16 16:09:57 +02:00
|
|
|
if [ -z "$EDITOR" ] ; then
|
2000-11-25 03:49:13 +01:00
|
|
|
EDITOR=vi
|
|
|
|
fi
|
|
|
|
|
|
|
|
function die()
|
|
|
|
{
|
|
|
|
echo $1
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo "Usage: $0 test_name"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
test_name=$1
|
|
|
|
|
2004-08-16 16:09:57 +02:00
|
|
|
[ -z "$test_name" ] && usage
|
2000-11-25 03:49:13 +01:00
|
|
|
|
2000-11-26 07:29:01 +01:00
|
|
|
result_file=$RESULT_DIR/$test_name.result
|
2002-09-26 22:08:22 +02:00
|
|
|
reject_file=$RESULT_DIR/$test_name.reject
|
2000-11-25 03:49:13 +01:00
|
|
|
|
|
|
|
[ -f $result_file ] && die "result file $result_file has already been created"
|
|
|
|
|
|
|
|
touch $result_file
|
|
|
|
echo "Running the test case against empty file, will fail, but don't worry"
|
2002-06-19 16:52:44 +02:00
|
|
|
./mysql-test-run --local $test_name
|
2000-11-25 03:49:13 +01:00
|
|
|
|
|
|
|
if [ -f $reject_file ] ; then
|
|
|
|
echo "Below are the contents of the reject file:"
|
|
|
|
echo "-----start---------------------"
|
2000-11-26 07:29:01 +01:00
|
|
|
cat $reject_file
|
2000-11-25 03:49:13 +01:00
|
|
|
echo "-----end-----------------------"
|
|
|
|
echo "Is this the output you expected from your test case?(y/n)[n]"
|
|
|
|
read yes_no
|
2000-11-26 07:29:01 +01:00
|
|
|
if [ x$yes_no = xy ] ; then
|
2000-11-25 03:49:13 +01:00
|
|
|
echo "Press any key to edit it in $EDITOR, or Ctrl-C to abort"
|
|
|
|
read junk
|
|
|
|
$EDITOR $reject_file
|
|
|
|
edited="edited"
|
|
|
|
fi
|
|
|
|
echo "Save $edited file as master result? (y/n)[y]"
|
|
|
|
read yes_no
|
|
|
|
if [ x$yes_no != xn ]; then
|
|
|
|
mv $reject_file $result_file
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "Your test failed so bad, it did not even produce a reject file"
|
|
|
|
echo "You need to fix your bugs in the test case, the code, or both"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|