From ae2542b63212719555901f7340de7f88691fb195 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Mar 2005 13:04:44 +0100 Subject: [PATCH 1/3] Ensure that the tests with '--ps-protocol' and '--embedded-server' are taken even after the previous run had some failures, provided it did not totally crash. Build-tools/Do-compile: Change the search string for a test run from "tests were successful" to just "were successful", which is written by the test run even after some failures. This is necessary to start the next test suite ('--ps-protocol', '--embedded-server') even after the previous one had some test failures. mysql-test/mysql-test-run.sh: Change the message even after test failures so that it is fairly safe to identify the end of the run from it (as opposed to a crash of the script). It is essential that both a run without any and with some test failures write "were successful" so that it can be grepped. --- Build-tools/Do-compile | 6 +++--- mysql-test/mysql-test-run.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index e7ab3357de9..f9074d113ff 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -392,13 +392,13 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) info("Running test suite"); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "were successful"); unless ($opt_skip_ps_test) { log_timestamp(); info("Running test suite using prepared statements"); - check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "were successful"); } unless ($opt_skip_embedded_test) @@ -407,7 +407,7 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) info("Running embedded server test suite"); # Embedded server and NDB don't jive $flags=~ s/ --with-ndbcluster//; - check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "were successful"); } # 'mysql-test-run' writes its own final message for log evaluation. } diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 8c484d2ddb1..d9172216919 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -833,7 +833,7 @@ report_stats () { whole=`$PRINTF %.2s $raw` xwhole=`$EXPR $whole \* 100` deci=`$EXPR $raw - $xwhole` - $ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% successful." + $ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% were successful." $ECHO "" $ECHO "The log files in $MY_LOG_DIR may give you some hint" $ECHO "of what when wrong." From 33f9d926f4ddb57d0b5a5a99565cd261bf828ccf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Mar 2005 21:13:46 +0100 Subject: [PATCH 2/3] Correct "make_win_src_distribution" to not introduce additional directory layers, adapt the Windows build files accordingly. VC++Files/tests/mysql_client_test.dsp: As the directory structure on Windows now resembles that on Unix (no more "tests/tests", by the correction in "make_win_src_distribution.sh"), the location of "mysql_client_test.*" has changed. Adapt the build tools accordingly. VC++Files/tests/mysql_client_test_ia64.dsp: As the directory structure on Windows now resembles that on Unix (no more "tests/tests", by the correction in "make_win_src_distribution.sh"), the location of "mysql_client_test.*" has changed. Adapt the build tools accordingly. scripts/make_win_src_distribution.sh: 1) The semantics of "cp -R src targ" depend on the (non)existence of "targ". By simply doing "$CP -R $i $BASE/$i", the directory hierarchy below $BASE differed from the source for each "$i" that already existed as a target directory. This is now prevented by checking the existence and adapting the command. 2) Comment where "$BASE" (the target directory) comes into existence. 3) Introduce an "abort" function as a start point for more sanity checks, use it. --- VC++Files/tests/mysql_client_test.dsp | 10 +++---- VC++Files/tests/mysql_client_test_ia64.dsp | 6 ++-- scripts/make_win_src_distribution.sh | 34 ++++++++++++++++------ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/VC++Files/tests/mysql_client_test.dsp b/VC++Files/tests/mysql_client_test.dsp index 3d1e6728181..14873c8a94c 100644 --- a/VC++Files/tests/mysql_client_test.dsp +++ b/VC++Files/tests/mysql_client_test.dsp @@ -51,8 +51,8 @@ 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\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 +# 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:"..\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:"..\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)" == "mysql_client_test - Win32 Release" @@ -76,8 +76,8 @@ 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 Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /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 Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /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 Ws2_32.lib /nologo /out:"..\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /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 Ws2_32.lib /nologo /out:"..\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console !ENDIF @@ -87,7 +87,7 @@ LINK32=link.exe # Name "mysql_client_test - Win32 Release" # Begin Source File -SOURCE=tests\mysql_client_test.c +SOURCE=mysql_client_test.c # End Source File # End Target # End Project diff --git a/VC++Files/tests/mysql_client_test_ia64.dsp b/VC++Files/tests/mysql_client_test_ia64.dsp index 6b4f29ed59f..f9dfbe5f027 100644 --- a/VC++Files/tests/mysql_client_test_ia64.dsp +++ b/VC++Files/tests/mysql_client_test_ia64.dsp @@ -48,16 +48,16 @@ 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 Ws2_32.lib /nologo /subsystem:console /out:"..\tests\mysql_client_test.exe" /machine:IA64 +# 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 Ws2_32.lib /nologo /subsystem:console /out:"..\mysql_client_test.exe" /machine:IA64 # SUBTRACT BASE LINK32 /pdb:none -# ADD LINK32 ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\libmysql.lib 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 Ws2_32.lib bufferoverflowU.lib /nologo /subsystem:console /nodefaultlib /out:"..\tests\mysql_client_test.exe" /machine:IA64 /machine:IA64 +# ADD LINK32 ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\libmysql.lib 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 Ws2_32.lib bufferoverflowU.lib /nologo /subsystem:console /nodefaultlib /out:"..\mysql_client_test.exe" /machine:IA64 /machine:IA64 # SUBTRACT LINK32 /pdb:none # Begin Target # Name "mysql_client_test - WinIA64 Release" # Begin Source File -SOURCE=tests\mysql_client_test.c +SOURCE=mysql_client_test.c DEP_CPP_MYSQL=\ "..\include\config-netware.h"\ "..\include\config-os2.h"\ diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index b52cc3799aa..036ed6fcc93 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -15,13 +15,26 @@ DIRNAME="" OUTTAR="0" OUTZIP="0" +# +# An "abort" function taking a variable number of strings (one per line) +# + +abort() +{ + for line + do + echo "$line" + done + exit 1 +} + + # # This script must run from MySQL top directory # if [ ! -f scripts/make_win_src_distribution ]; then - echo "ERROR : You must run this script from the MySQL top-level directory" - exit 1 + abort "ERROR : You must run this script from the MySQL top-level directory" fi SOURCE=`pwd` @@ -30,9 +43,8 @@ SOURCE=`pwd` # if [ ! -f sql/sql_yacc.cc ]; then - echo "ERROR : Sorry, you must run this script after the complete build," - echo " hope you know what you are trying to do !!" - exit 1 + abort "ERROR : Sorry, you must run this script after the complete build," \ + " hope you know what you are trying to do !!" fi # @@ -86,9 +98,7 @@ parse_arguments() { --tar) OUTTAR=1 ;; --zip) OUTZIP=1 ;; --help) show_usage ;; - *) - echo "Unknown argument '$arg'" - exit 1 + *) abort "Unknown argument '$arg'" ;; esac done @@ -138,6 +148,7 @@ if [ -d $BASE ] ; then fi $CP -r $SOURCE/VC++Files $BASE +# This includes an implicit 'mkdir $BASE' ! # # Process version tags in InstallShield files @@ -310,7 +321,12 @@ do print_debug "Copying directory '$i'" if [ -d $i ] then - $CP -R $i $BASE/$i + if [ -d $BASE/$i ] + then + $CP -R $i $BASE + else + $CP -R $i $BASE/$i + fi fi done From 335f4fd88601cd7865aa3594f18834826bb3302f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Mar 2005 11:08:27 +0100 Subject: [PATCH 3/3] Keep the Perl version of 'mysql-test-run' in sync with the shell script. mysql-test/lib/mtr_report.pl: Keep the Perl version in sync with the shell script so that 'Do-compile' will call PS and ES tests even after some previous test failures. (See previous change to 'mysql-test-run.sh' and 'Do-compile'.) --- mysql-test/lib/mtr_report.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 3729ff512ee..9947fed9d27 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -161,7 +161,7 @@ sub mtr_report_stats ($) { { my $ratio= $tot_passed * 100 / $tot_tests; printf "Failed $tot_failed/$tot_tests tests, " . - "%.2f\% successful.\n\n", $ratio; + "%.2f\% were successful.\n\n", $ratio; print "The log files in var/log may give you some hint\n", "of what when wrong.\n",