Commit 155e1ec3 authored by kent@mysql.com's avatar kent@mysql.com

client_test.test:

  Run client_test as a testcase
  new file
mysql-test-run.sh:
  More clearly report failure if --force, also exit 1
client_test.c:
  Use MAXPATHLEN in test_frm_bug()
  Renable test cases disabled for running from mysql-test-run
mysqltest.c:
  Don't check errno from popen, may not be set
parent 9b8030d0
...@@ -847,7 +847,7 @@ int do_source(struct st_query* q) ...@@ -847,7 +847,7 @@ int do_source(struct st_query* q)
static void do_exec(struct st_query* q) static void do_exec(struct st_query* q)
{ {
int error; int error;
DYNAMIC_STRING *ds = NULL; /* Assign just to avoid warning */ DYNAMIC_STRING *ds= NULL; /* Assign just to avoid warning */
DYNAMIC_STRING ds_tmp; DYNAMIC_STRING ds_tmp;
char buf[1024]; char buf[1024];
FILE *res_file; FILE *res_file;
...@@ -889,7 +889,7 @@ static void do_exec(struct st_query* q) ...@@ -889,7 +889,7 @@ static void do_exec(struct st_query* q)
error= pclose(res_file); error= pclose(res_file);
if (error != 0) if (error != 0)
die("command \"%s\" failed: %s", cmd, errno); die("command \"%s\" failed", cmd);
if (!disable_result_log) if (!disable_result_log)
{ {
......
...@@ -208,6 +208,7 @@ MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log ...@@ -208,6 +208,7 @@ MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root MYSQL_MANAGER_USER=root
NO_SLAVE=0 NO_SLAVE=0
USER_TEST= USER_TEST=
FAILED_CASES=
EXTRA_MASTER_OPT="" EXTRA_MASTER_OPT=""
EXTRA_MYSQL_TEST_OPT="" EXTRA_MYSQL_TEST_OPT=""
...@@ -1376,7 +1377,7 @@ run_testcase () ...@@ -1376,7 +1377,7 @@ run_testcase ()
fi fi
exit 1 exit 1
fi fi
FAILED_CASES="$FAILED_CASES $tname"
if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ]
then then
mysql_restart mysql_restart
...@@ -1562,4 +1563,10 @@ $ECHO ...@@ -1562,4 +1563,10 @@ $ECHO
[ "$DO_GCOV" ] && gcov_collect # collect coverage information [ "$DO_GCOV" ] && gcov_collect # collect coverage information
[ "$DO_GPROF" ] && gprof_collect # collect coverage information [ "$DO_GPROF" ] && gprof_collect # collect coverage information
exit 0 if [ $TOT_FAIL -ne 0 ]; then
$ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES"
$ECHO
exit 1
else
exit 0
fi
-- disable_result_log
--exec ../tests/client_test --testcase --user=root --socket=var/tmp/master.sock --port=$MYSQL_TCP_PORT
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <m_string.h> #include <m_string.h>
#include <assert.h> #include <assert.h>
#ifdef HAVE_SYS_PARAM_H #ifdef HAVE_SYS_PARAM_H
/* Include to get MAXPATHLEN */
#include <sys/param.h> #include <sys/param.h>
#endif #endif
...@@ -6588,7 +6589,7 @@ static void test_frm_bug() ...@@ -6588,7 +6589,7 @@ static void test_frm_bug()
bind[0].buffer_type= MYSQL_TYPE_STRING; bind[0].buffer_type= MYSQL_TYPE_STRING;
bind[0].buffer= data_dir; bind[0].buffer= data_dir;
bind[0].buffer_length= NAME_LEN; bind[0].buffer_length= MAXPATHLEN;
bind[0].is_null= 0; bind[0].is_null= 0;
bind[0].length= 0; bind[0].length= 0;
bind[1]= bind[0]; bind[1]= bind[0];
...@@ -10454,7 +10455,7 @@ static struct my_option client_test_long_options[] = ...@@ -10454,7 +10455,7 @@ static struct my_option client_test_long_options[] =
(char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection", (char **) &opt_unix_socket, {"socket", 'S', "Socket file to use for connection", (char **) &opt_unix_socket,
(char **) &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (char **) &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"testcase", 'c', "Runs as mysql-test-run testcase.", {"testcase", 'c', "May disable some code when runs as mysql-test-run testcase.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"count", 't', "Number of times test to be executed", (char **) &opt_count, {"count", 't', "Number of times test to be executed", (char **) &opt_count,
(char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
...@@ -10642,8 +10643,7 @@ int main(int argc, char **argv) ...@@ -10642,8 +10643,7 @@ int main(int argc, char **argv)
test_warnings(); /* show warnings test */ test_warnings(); /* show warnings test */
test_errors(); /* show errors test */ test_errors(); /* show errors test */
test_prepare_resultset();/* prepare meta info test */ test_prepare_resultset();/* prepare meta info test */
if (!opt_testcase) /* FIXME: skipped because it hangs */ test_stmt_close(); /* mysql_stmt_close() test -- hangs */
test_stmt_close(); /* mysql_stmt_close() test -- hangs */
test_prepare_field_result(); /* prepare meta info */ test_prepare_field_result(); /* prepare meta info */
test_multi_stmt(); /* multi stmt test */ test_multi_stmt(); /* multi stmt test */
test_multi_statements();/* test multi statement execution */ test_multi_statements();/* test multi statement execution */
...@@ -10671,8 +10671,7 @@ int main(int argc, char **argv) ...@@ -10671,8 +10671,7 @@ int main(int argc, char **argv)
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
test_prepare_grant(); /* Test the GRANT command, bug #89 */ test_prepare_grant(); /* Test the GRANT command, bug #89 */
#endif #endif
if (!opt_testcase) /* FIXME: skipped because it fails */ test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */
test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */
test_explain_bug(); /* test for the EXPLAIN, bug #115 */ test_explain_bug(); /* test for the EXPLAIN, bug #115 */
test_decimal_bug(); /* test for the decimal bug */ test_decimal_bug(); /* test for the decimal bug */
test_nstmts(); /* test n statements */ test_nstmts(); /* test n statements */
...@@ -10735,8 +10734,7 @@ int main(int argc, char **argv) ...@@ -10735,8 +10734,7 @@ int main(int argc, char **argv)
dates in the server */ dates in the server */
test_bug5399(); /* check that statement id uniquely identifies test_bug5399(); /* check that statement id uniquely identifies
statement */ statement */
if (!opt_testcase) test_bug5194(); /* bulk inserts in prepared mode */
test_bug5194(); /* bulk inserts in prepared mode */
test_bug5315(); /* check that mysql_change_user closes all test_bug5315(); /* check that mysql_change_user closes all
prepared statements */ prepared statements */
/* /*
......
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