From: mistachkin Date: Mon, 2 Nov 2015 23:29:58 +0000 (+0000) Subject: Attempt to centralize and simplify the MSVC handling. X-Git-Tag: version-3.10.0~178^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da9da5624af05ce9d2d8cedfdef27866b89fe519;p=thirdparty%2Fsqlite.git Attempt to centralize and simplify the MSVC handling. FossilOrigin-Name: 4ae96d6dde7fc0a913d7719ec498686f9a1e3b98 --- diff --git a/manifest b/manifest index 1b88902e77..0347e7e67c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sbackcompat.test\smodule\sso\sthat\sit\sdoes\snot\stry\sto\scompare\sagainst\sitself\non\swindows. -D 2015-11-02T23:21:17.389 +C Attempt\sto\scentralize\sand\ssimplify\sthe\sMSVC\shandling. +D 2015-11-02T23:29:58.179 F Makefile.in 4469ed8b02a9934fea9503d791165367d19db2f7 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4 @@ -948,7 +948,7 @@ F test/rbu.test 168573d353cd0fd10196b87b0caa322c144ef736 F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254 -F test/releasetest.tcl 39d6de145cc95e81a6a48cead3fa7825a01040d3 +F test/releasetest.tcl 203d4ae4b5967f45aff3a702f5ceca0e374c2701 F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14 @@ -1397,7 +1397,10 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 22cc3e6c8e7f7eed854f8a50138ccb9c79bb7a23 -R c5c631dd7ea4596095ad68ee5913e438 -U drh -Z 0cc762df2756575e67d282e298d9c9ef +P f625bce8b7c2884a092c70675a9c6ce15c29937e +R eb29c38bdfc8b6dd27ad862c284260aa +T *branch * msvcRefactor +T *sym-msvcRefactor * +T -sym-mp-releasetest * +U mistachkin +Z b0a92943833683434e791bb83f5a4e2b diff --git a/manifest.uuid b/manifest.uuid index 824dd2391f..c1778b7e5c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f625bce8b7c2884a092c70675a9c6ce15c29937e \ No newline at end of file +4ae96d6dde7fc0a913d7719ec498686f9a1e3b98 \ No newline at end of file diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 19867f8ff6..dea09a6ebe 100644 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -286,7 +286,7 @@ array set ::Platforms [strip_comments { ######################################################################### ######################################################################### -# Configuration verification: Check that each entry in the list of configs +# Configuration verification: Check that each entry in the list of configs # specified for each platforms exists. # foreach {key value} [array get ::Platforms] { @@ -392,12 +392,12 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} { #-------------------------------------------------------------------------- # This command is invoked as the [main] routine for scripts run with the -# "--slave" option. +# "--slave" option. # # For each test (i.e. "configure && make test" execution), the master # process spawns a process with the --slave option. It writes two lines -# to the slaves stdin. The first contains a single boolean value - the -# value of ::TRACE to use in the slave script. The second line contains a +# to the slaves stdin. The first contains a single boolean value - the +# value of ::TRACE to use in the slave script. The second line contains a # list in the same format as each element of the list passed to the # [run_all_test_suites] command in the master process. # @@ -412,7 +412,7 @@ proc run_slave_test {} { # Read the test-suite configuration from stdin. set T [gets stdin] - foreach {title dir configOpts testtarget cflags opts} $T {} + foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} # Create and switch to the test directory. trace_cmd file mkdir $dir @@ -430,7 +430,7 @@ proc run_slave_test {} { unset -nocomplain savedEnv(TCLSH_CMD) } set ::env(TCLSH_CMD) [file nativename [info nameofexecutable]] - set rc [catch [makeCommand $testtarget $cflags $opts]] + set rc [catch [makeCommand $testtarget $makeOpts $cflags $opts]] if {[info exists savedEnv(TCLSH_CMD)]} { set ::env(TCLSH_CMD) $savedEnv(TCLSH_CMD) } else { @@ -443,12 +443,12 @@ proc run_slave_test {} { exit $rc } -# This command is invoked in the master process each time a slave +# This command is invoked in the master process each time a slave # file-descriptor is readable. # proc slave_fileevent {fd T tm1} { global G - foreach {title dir configOpts testtarget cflags opts} $T {} + foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} if {[eof $fd]} { fconfigure $fd -blocking 1 @@ -503,7 +503,7 @@ proc slave_fileevent {fd T tm1} { # * The first argument for [makeCommand] # * The second argument for [makeCommand] # * The third argument for [makeCommand] -# +# proc run_all_test_suites {alltests} { global G set tests $alltests @@ -518,7 +518,7 @@ proc run_all_test_suites {alltests} { if {[llength $tests]>0} { set T [lindex $tests 0] set tests [lrange $tests 1 end] - foreach {title dir configOpts testtarget cflags opts} $T {} + foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} if {!$::TRACE} { set n [string length $title] PUTS "starting: ${title}" @@ -548,6 +548,7 @@ proc add_test_suite {listvar name testtarget config} { # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but # CFLAGS is only passed to gcc. # + set makeOpts "" set cflags [expr {$::MSVC ? "-Zi" : "-g"}] set opts "" set title ${name}($testtarget) @@ -560,34 +561,70 @@ proc add_test_suite {listvar name testtarget config} { } elseif {[regexp {^[A-Z]+=} $arg]} { lappend testtarget $arg } elseif {[regexp {^--(enable|disable)-} $arg]} { + if {$::MSVC} { + if {$arg eq "--disable-amalgamation"} { + lappend makeOpts USE_AMALGAMATION=0 + continue + } + if {$arg eq "--disable-shared"} { + lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0 + continue + } + if {$arg eq "--enable-fts5"} { + lappend opts -DSQLITE_ENABLE_FTS5 + continue + } + if {$arg eq "--enable-json1"} { + lappend opts -DSQLITE_ENABLE_JSON1 + continue + } + } lappend configOpts $arg } else { + if {$::MSVC} { + if {$arg eq "-g"} { + lappend cflags -Zi + continue + } + if {[regexp -- {^-O(\d+)$} $arg all level]} then { + lappend makeOpts OPTIMIZATIONS=$level + continue + } + } lappend cflags $arg } } - set cflags [join $cflags " "] - set opts [join $opts " "] - append opts " -DSQLITE_NO_SYNC=1" + # Disable sync to make testing faster. + # + lappend 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" + if {[lsearch -regexp $opts {^-DHAVE_USLEEP(?:=|$)}]==-1} { + lappend opts -DHAVE_USLEEP=1 } - # Set the sub-directory to use. + # Add the define for this platform. # - set dir [string tolower [string map {- _ " " _} $name]] - if {$::tcl_platform(platform)=="windows"} { - append opts " -DSQLITE_OS_WIN=1" + lappend opts -DSQLITE_OS_WIN=1 } else { - append opts " -DSQLITE_OS_UNIX=1" + lappend opts -DSQLITE_OS_UNIX=1 } - lappend alltests [list $title $dir $configOpts $testtarget $cflags $opts] + # Set the sub-directory to use. + # + set dir [string tolower [string map {- _ " " _} $name]] + + # Join option lists into strings, using space as delimiter. + # + set makeOpts [join $makeOpts " "] + set cflags [join $cflags " "] + set opts [join $opts " "] + + lappend alltests [list \ + $title $dir $configOpts $testtarget $makeOpts $cflags $opts] } # The following procedure returns the "configure" command to be exectued for @@ -607,15 +644,19 @@ proc configureCommand {opts} { # The following procedure returns the "make" command to be executed for the # specified targets, compiler flags, and options. # -proc makeCommand { targets cflags opts } { +proc makeCommand { targets makeOpts cflags opts } { 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 + lappend result nmake /f $nmakeFile TOP=$nmakeDir } else { - lappend result make clean + lappend result make + } + foreach makeOpt $makeOpts { + lappend result $makeOpt } + lappend result clean foreach target $targets { lappend result $target } @@ -733,11 +774,7 @@ proc process_options {argv} { } -g { - if {$::MSVC} { - lappend ::EXTRACONFIG -Zi - } else { - lappend ::EXTRACONFIG [lindex $argv $i] - } + lappend ::EXTRACONFIG [lindex $argv $i] } -with-tcl=* {