1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Enhance the 'releasetest.tcl' tool to support MSVC.

FossilOrigin-Name: f664bfdc82597a4530d4f4938bb96557b43b171b
This commit is contained in:
mistachkin
2015-04-04 00:02:07 +00:00
parent 34cf258302
commit 00eb70d89c
4 changed files with 77 additions and 17 deletions

View File

@@ -1608,6 +1608,9 @@ queryplantest: testfixture.exe sqlite3.exe
test: testfixture.exe sqlite3.exe test: testfixture.exe sqlite3.exe
.\testfixture.exe $(TOP)\test\veryquick.test .\testfixture.exe $(TOP)\test\veryquick.test
smoketest: testfixture.exe
.\testfixture.exe $(TOP)\test\main.test
sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl sqlite3_analyzer.c: $(SQLITE3C) $(TOP)\src\test_stat.c $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl
copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@ copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
echo static const char *tclsh_main_loop(void){ >> $@ echo static const char *tclsh_main_loop(void){ >> $@

View File

@@ -1,9 +1,9 @@
C Fix\sbuild\swith\sOSTRACE\senabled\son\sWindows\swhen\sbuilding\susing\sseparate\ssource\sfiles. C Enhance\sthe\s'releasetest.tcl'\stool\sto\ssupport\sMSVC.
D 2015-04-02T17:46:52.559 D 2015-04-04T00:02:07.856
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 00d12636df7a5b08af09116bcd6c7bfd49b8b3b4 F Makefile.in 00d12636df7a5b08af09116bcd6c7bfd49b8b3b4
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F Makefile.msc c3744ee851d76d2be0ff247f5a89a74c88f2ece2 F Makefile.msc a95303d8bd37f8cf176be19cb5542355cc3c243b
F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866
F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60 F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60
@@ -812,7 +812,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8 F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
F test/releasetest.tcl 13f401c10dd4fe1a2fb811ae6ed27fd7d1300d3c F test/releasetest.tcl a37cd82092c8be438255d65804b5951d6e3ecdae
F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a
F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14
@@ -1248,7 +1248,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 5c965a71b957fdb0310ac1af9bf2fc3b418af668 P 5f6e35802fcf7b5e9fc3dd4424e9074523fa8ad3
R a13de84916db5713aa965bbf949c399f R beb5360693babbdb25b957a67e8a7b0e
U mistachkin U mistachkin
Z d93e90a8dd0c05d351cfea868c3bfa91 Z 6aedfad85a42d725bf8ce314c14e99d1

View File

@@ -1 +1 @@
5f6e35802fcf7b5e9fc3dd4424e9074523fa8ad3 f664bfdc82597a4530d4f4938bb96557b43b171b

View File

@@ -14,6 +14,7 @@ optional) are:
--config CONFIGNAME (Run only CONFIGNAME) --config CONFIGNAME (Run only CONFIGNAME)
--quick (Run "veryquick.test" only) --quick (Run "veryquick.test" only)
--veryquick (Run "make smoketest" only) --veryquick (Run "make smoketest" only)
--msvc (Use MSVC as the compiler)
--buildonly (Just build testfixture - do not run) --buildonly (Just build testfixture - do not run)
--dryrun (Print what would have happened) --dryrun (Print what would have happened)
--info (Show diagnostic info) --info (Show diagnostic info)
@@ -22,8 +23,9 @@ The default value for --srcdir is the parent of the directory holding
this script. this script.
The script determines the default value for --platform using the The script determines the default value for --platform using the
$tcl_platform(os) and $tcl_platform(machine) variables. Supported $tcl_platform(os) and $tcl_platform(machine) variables. Supported
platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386". platforms are "Linux-x86", "Linux-x86_64", "Darwin-i386",
"Darwin-x86_64", "Windows NT-intel", and "Windows NT-amd64".
Every test begins with a fresh run of the configure script at the top Every test begins with a fresh run of the configure script at the top
of the SQLite source tree. of the SQLite source tree.
@@ -238,6 +240,10 @@ array set ::Platforms [strip_comments {
"Default" "mptest fulltestonly" "Default" "mptest fulltestonly"
"Have-Not" test "Have-Not" test
} }
"Windows NT-amd64" {
"Default" "mptest fulltestonly"
"Have-Not" test
}
# The Failure-Detection platform runs various tests that deliberately # The Failure-Detection platform runs various tests that deliberately
# fail. This is used as a test of this script to verify that this script # fail. This is used as a test of this script to verify that this script
@@ -296,6 +302,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} {
set errmsg $msg set errmsg $msg
} }
} }
if {[regexp {fatal error +(.*)} $line all msg]} {
incr ::NERRCASE
if {$rc==0} {
set rc 1
set errmsg $msg
}
}
if {[regexp {ERROR SUMMARY: (\d+) errors.*} $line all cnt] && $cnt>0} { if {[regexp {ERROR SUMMARY: (\d+) errors.*} $line all cnt] && $cnt>0} {
incr ::NERRCASE incr ::NERRCASE
if {$rc==0} { if {$rc==0} {
@@ -314,7 +327,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} {
} }
} }
close $fd close $fd
if {!$seen} { if {$::BUILDONLY} {
if {$rc==0} {
set errmsg "Build complete"
} else {
set errmsg "Build failed"
}
} elseif {!$seen} {
set rc 1 set rc 1
set errmsg "Test did not complete" set errmsg "Test did not complete"
if {[file readable core]} { if {[file readable core]} {
@@ -329,7 +348,7 @@ proc run_test_suite {name testtarget config} {
# CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but
# CFLAGS is only passed to gcc. # CFLAGS is only passed to gcc.
# #
set cflags "-g" set cflags [expr {$::MSVC ? "-Zi" : "-g"}]
set opts "" set opts ""
set title ${name}($testtarget) set title ${name}($testtarget)
set configOpts "" set configOpts ""
@@ -349,7 +368,14 @@ proc run_test_suite {name testtarget config} {
set cflags [join $cflags " "] set cflags [join $cflags " "]
set opts [join $opts " "] set opts [join $opts " "]
append opts " -DSQLITE_NO_SYNC=1 -DHAVE_USLEEP" append opts " -DSQLITE_NO_SYNC=1"
# Some configurations already set HAVE_USLEEP; in that case, skip it.
#
if {![regexp { -DHAVE_USLEEP$} $opts]
&& ![regexp { -DHAVE_USLEEP[ =]+} $opts]} {
append opts " -DHAVE_USLEEP=1"
}
# Set the sub-directory to use. # Set the sub-directory to use.
# #
@@ -390,10 +416,10 @@ proc run_test_suite {name testtarget config} {
if {$rc} { if {$rc} {
puts " FAIL $tm" puts " FAIL $tm"
incr ::NERR incr ::NERR
if {$errmsg!=""} {puts " $errmsg"}
} else { } else {
puts " Ok $tm" puts " Ok $tm"
} }
if {$errmsg!=""} {puts " $errmsg"}
} }
} }
@@ -401,6 +427,7 @@ proc run_test_suite {name testtarget config} {
# the current platform, which may be Windows (via MinGW, etc). # the current platform, which may be Windows (via MinGW, etc).
# #
proc configureCommand {opts} { proc configureCommand {opts} {
if {$::MSVC} return [list]; # This is not needed for MSVC.
set result [list trace_cmd exec] set result [list trace_cmd exec]
if {$::tcl_platform(platform)=="windows"} { if {$::tcl_platform(platform)=="windows"} {
lappend result sh lappend result sh
@@ -414,7 +441,14 @@ proc configureCommand {opts} {
# specified targets, compiler flags, and options. # specified targets, compiler flags, and options.
# #
proc makeCommand { targets cflags opts } { proc makeCommand { targets cflags opts } {
set result [list trace_cmd exec make clean] set result [list trace_cmd exec]
if {$::MSVC} {
set nmakeDir [file nativename $::SRCDIR]
set nmakeFile [file join $nmakeDir Makefile.msc]
lappend result nmake /f $nmakeFile TOP=$nmakeDir clean
} else {
lappend result make clean
}
foreach target $targets { foreach target $targets {
lappend result $target lappend result $target
} }
@@ -443,6 +477,7 @@ proc trace_cmd {args} {
proc process_options {argv} { proc process_options {argv} {
set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]]
set ::QUICK 0 set ::QUICK 0
set ::MSVC 0
set ::BUILDONLY 0 set ::BUILDONLY 0
set ::DRYRUN 0 set ::DRYRUN 0
set ::EXEC exec set ::EXEC exec
@@ -476,6 +511,10 @@ proc process_options {argv} {
set config [lindex $argv $i] set config [lindex $argv $i]
} }
-msvc {
set ::MSVC 1
}
-buildonly { -buildonly {
set ::BUILDONLY 1 set ::BUILDONLY 1
} }
@@ -494,6 +533,7 @@ proc process_options {argv} {
puts " --platform [list $platform]" puts " --platform [list $platform]"
puts " --config [list $config]" puts " --config [list $config]"
if {$::QUICK} {puts " --quick"} if {$::QUICK} {puts " --quick"}
if {$::MSVC} {puts " --msvc"}
if {$::BUILDONLY} {puts " --buildonly"} if {$::BUILDONLY} {puts " --buildonly"}
if {$::DRYRUN} {puts " --dryrun"} if {$::DRYRUN} {puts " --dryrun"}
if {$::TRACE} {puts " --trace"} if {$::TRACE} {puts " --trace"}
@@ -507,7 +547,15 @@ proc process_options {argv} {
} }
exit exit
} }
-g -
-g {
if {$::MSVC} {
lappend ::EXTRACONFIG -Zi
} else {
lappend ::EXTRACONFIG [lindex $argv $i]
}
}
-D* - -D* -
-O* - -O* -
-enable-* - -enable-* -
@@ -547,6 +595,7 @@ proc process_options {argv} {
puts -nonewline "Flags:" puts -nonewline "Flags:"
if {$::DRYRUN} {puts -nonewline " --dryrun"} if {$::DRYRUN} {puts -nonewline " --dryrun"}
if {$::BUILDONLY} {puts -nonewline " --buildonly"} if {$::BUILDONLY} {puts -nonewline " --buildonly"}
if {$::MSVC} {puts -nonewline " --msvc"}
switch -- $::QUICK { switch -- $::QUICK {
1 {puts -nonewline " --quick"} 1 {puts -nonewline " --quick"}
2 {puts -nonewline " --veryquick"} 2 {puts -nonewline " --veryquick"}
@@ -570,12 +619,20 @@ proc main {argv} {
set ::SQLITE_VERSION {} set ::SQLITE_VERSION {}
set STARTTIME [clock seconds] set STARTTIME [clock seconds]
foreach {zConfig target} $::CONFIGLIST { foreach {zConfig target} $::CONFIGLIST {
if {$::MSVC && ($zConfig eq "Sanitize" || "checksymbols" in $target
|| "valgrindtest" in $target)} {
puts "Skipping $zConfig / $target for MSVC..."
continue
}
if {$target ne "checksymbols"} { if {$target ne "checksymbols"} {
switch -- $::QUICK { switch -- $::QUICK {
1 {set target test} 1 {set target test}
2 {set target smoketest} 2 {set target smoketest}
} }
if {$::BUILDONLY} {set target testfixture} if {$::BUILDONLY} {
set target testfixture
if {$::MSVC} {append target .exe}
}
} }
set config_options [concat $::Configs($zConfig) $::EXTRACONFIG] set config_options [concat $::Configs($zConfig) $::EXTRACONFIG]