diff options
author | unknown <wax@kishkin.ru> | 2005-02-02 19:53:49 +0500 |
---|---|---|
committer | unknown <wax@kishkin.ru> | 2005-02-02 19:53:49 +0500 |
commit | 5de673901f291668fa577a55faeb57d06016eb8b (patch) | |
tree | 9301ca8c793bebb2821ffd5da3f5cb3cca9d4a54 | |
parent | dc472dca33cc1d61d546a56f22fcb45419d04507 (diff) | |
download | mariadb-git-5de673901f291668fa577a55faeb57d06016eb8b.tar.gz |
WL#964
renamed client_test to mysql_client_test
fixed name for lstat in removef()
added mysql-debug.exe for Windows
added enviroment variable MYSQL_CLIENT_TEST
added cleaning directory before tests
New BitKeeper file ``VC++Files/tests/mysql_client_test.dsp''
Delete: VC++Files/tests/client_test.dsp
BitKeeper/deleted/.del-client_test.dsp~659d0237a4c12ea1:
Delete: VC++Files/tests/client_test.dsp
VC++Files/mysql.dsw:
renamed client_test to mysql_client_test
mysql-test/my_manage.c:
fixed name for lstat in removef()
mysql-test/mysql_test_run_new.c:
added mysql-debug.exe for Windows
added enviroment variable MYSQL_CLIENT_TEST
added cleaning directory before tests
-rw-r--r-- | VC++Files/mysql.dsw | 21 | ||||
-rw-r--r-- | VC++Files/tests/mysql_client_test.dsp (renamed from VC++Files/tests/client_test.dsp) | 34 | ||||
-rw-r--r-- | mysql-test/my_manage.c | 12 | ||||
-rw-r--r-- | mysql-test/mysql_test_run_new.c | 34 |
4 files changed, 69 insertions, 32 deletions
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index d6bf5819909..d36cbc7a031 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -819,8 +819,9 @@ Package=<4> Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4>
Package=<5>
-{{{
}}} - +{{{ +
}}} +
Package=<4>
{{{
Begin Project Dependency @@ -834,7 +835,19 @@ Package=<4> End Project Dependency }}} -###############################################################################
Project: "client_test"=.\tests\client_test.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
############################################################################### +###############################################################################
+
+Project: "mysql_client_test"=.\tests\mysql_client_test.dsp - Package Owner=<4> +
+
Package=<5>
+{{{
+
}}} +
+
Package=<4> +
{{{ +
}}} + +
############################################################################### Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4>
@@ -851,7 +864,7 @@ Package=<4> Project_Dep_Name mysqladmin End Project Dependency Begin Project Dependency - Project_Dep_Name client_test + Project_Dep_Name mysql_client_test End Project Dependency }}} diff --git a/VC++Files/tests/client_test.dsp b/VC++Files/tests/mysql_client_test.dsp index a095906b26e..07014487bd1 100644 --- a/VC++Files/tests/client_test.dsp +++ b/VC++Files/tests/mysql_client_test.dsp @@ -1,24 +1,24 @@ -# Microsoft Developer Studio Project File - Name="client_test" - Package Owner=<4>
+# Microsoft Developer Studio Project File - Name="mysql_client_test" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
-CFG=client_test - Win32 Debug
+CFG=mysql_client_test - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
-!MESSAGE NMAKE /f "client_test.mak".
+!MESSAGE NMAKE /f "mysql_client_test.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "client_test.mak" CFG="client_test - Win32 Debug"
+!MESSAGE NMAKE /f "mysql_client_test.mak" CFG="mysql_client_test - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "client_test - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE "client_test - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysql_client_test - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "mysql_client_test - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
@@ -29,7 +29,7 @@ CPP=cl.exe MTL=midl.exe
RSC=rc.exe
-!IF "$(CFG)" == "client_test - Win32 Debug"
+!IF "$(CFG)" == "mysql_client_test - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
@@ -41,20 +41,20 @@ RSC=rc.exe # PROP Output_Dir ".\Debug"
# PROP Intermediate_Dir ".\Debug"
# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
-# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
-# ADD BASE MTL /nologo /tlb".\Debug\client_test.tlb" /win32
-# ADD MTL /nologo /tlb".\Debug\client_test.tlb" /win32
+# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX
+# ADD BASE MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
+# ADD MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32
# ADD BASE RSC /l 1033
# ADD RSC /l 1033
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console
-!ELSEIF "$(CFG)" == "client_test - Win32 Release"
+!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -83,11 +83,11 @@ LINK32=link.exe # Begin Target
-# Name "client_test - Win32 Debug"
-# Name "client_test - Win32 Release"
+# Name "mysql_client_test - Win32 Debug"
+# Name "mysql_client_test - Win32 Release"
# Begin Source File
-SOURCE=mysql_client_test.c
+SOURCE=tests\mysql_client_test.c
# End Source File
# End Target
# End Project
diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 5cd0013d7bb..88e68dfc27e 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -644,7 +644,7 @@ void del_tree(char *dir) if (lstat(entry->d_name, &st) == -1) { /* FIXME error */ - return; + return; } if (S_ISDIR(st.st_mode)) #else @@ -800,7 +800,15 @@ int removef(const char *format, ...) #ifndef STRUCT_DIRENT_HAS_D_TYPE struct stat st; - if (lstat(entry->d_name, &st) == -1 && !fnmatch(p, entry->d_name,0)) + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); + + if (lstat(temp, &st) == -1) + { + return 1; /* Error couldn't lstat file */ + } + + if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) #else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) #endif diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 4e0e018f84b..40e45a92851 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1021,14 +1021,6 @@ void run_test(char *test) char err_file[FN_REFLEN]; int err; arg_list_t al; -#ifdef __WIN__ - /* Clean test database */ - removef("%s/test/*.*", master_dir); - removef("%s/test/*.*", slave_dir); - removef("%s/mysqltest/*.*", master_dir); - removef("%s/mysqltest/*.*", slave_dir); - -#endif /* skip slave? */ flag= skip_slave; skip_slave= (strncmp(test, "rpl", 3) != 0); @@ -1393,7 +1385,11 @@ void setup(char *file __attribute__((unused))) snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ +#ifdef _DEBUG + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld-debug.exe", bin_dir); +#else snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir); +#endif snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir); snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir); #else @@ -1494,6 +1490,13 @@ void setup(char *file __attribute__((unused))) snprintf(file_path, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --port=%u --silent", + base_dir, master_port); + _putenv(file_path); + #else { static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; @@ -1506,6 +1509,7 @@ void setup(char *file __attribute__((unused))) static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; static char env_CLIENT_BINDIR[FN_REFLEN*2]; + static char env_MYSQL_CLIENT_TEST[FN_REFLEN*2]; snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, "MYSQL_TEST_DIR=%s",mysql_test_dir); @@ -1552,6 +1556,13 @@ void setup(char *file __attribute__((unused))) snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); putenv(env_CLIENT_BINDIR); + + snprintf(env_MYSQL_CLIENT_TEST, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --socket=%s --port=%u --silent", + base_dir, master_socket, master_port); + putenv(env_MYSQL_CLIENT_TEST); + } #endif @@ -1592,8 +1603,13 @@ int main(int argc, char **argv) char **testes= 0; int name_index; int index; + char var_dir[FN_REFLEN]; /* setup */ setup(argv[0]); + + /* delete all file in var */ + snprintf(var_dir,FN_REFLEN,"%s/var",mysql_test_dir); + del_tree(var_dir); /* The --ignore option is comma saperated list of test cases to skip and @@ -1633,7 +1649,7 @@ int main(int argc, char **argv) /* install test databases */ mysql_install_db(); - + mlog("Starting Tests...\n"); mlog("\n"); |