]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Enhance the 'releasetest.tcl' tool to support MSVC.
authormistachkin <mistachkin@noemail.net>
Sat, 4 Apr 2015 00:02:07 +0000 (00:02 +0000)
committermistachkin <mistachkin@noemail.net>
Sat, 4 Apr 2015 00:02:07 +0000 (00:02 +0000)
FossilOrigin-Name: f664bfdc82597a4530d4f4938bb96557b43b171b

Makefile.msc
manifest
manifest.uuid
test/releasetest.tcl

index d3a40a811b13c9556c78d2271ebe8fe4c86baeb3..e68fb78717980d0d220eb15e5526ff6593b08548 100644 (file)
@@ -1608,6 +1608,9 @@ queryplantest:    testfixture.exe sqlite3.exe
 test:  testfixture.exe sqlite3.exe
        .\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
        copy $(SQLITE3C) + $(TOP)\src\test_stat.c + $(TOP)\src\tclsqlite.c $@
        echo static const char *tclsh_main_loop(void){ >> $@
index dabb61374f14e8ad9c421ed9c62371f384ec082f..e2d9993f0b9db62a1e13cf20341048a1b3ab2c97 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Fix\sbuild\swith\sOSTRACE\senabled\son\sWindows\swhen\sbuilding\susing\sseparate\ssource\sfiles.
-D 2015-04-02T17:46:52.559
+C Enhance\sthe\s'releasetest.tcl'\stool\sto\ssupport\sMSVC.
+D 2015-04-04T00:02:07.856
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 00d12636df7a5b08af09116bcd6c7bfd49b8b3b4
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
-F Makefile.msc c3744ee851d76d2be0ff247f5a89a74c88f2ece2
+F Makefile.msc a95303d8bd37f8cf176be19cb5542355cc3c243b
 F Makefile.vxworks e1b65dea203f054e71653415bd8f96dcaed47858
 F README.md d58e3bebc0a4145e0f2a87994015fdb575a8e866
 F VERSION 319eb1ced4b4d17a67730f2b7b85f15c1346cb60
@@ -812,7 +812,7 @@ F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
 F test/rdonly.test 64e2696c322e3538df0b1ed624e21f9a23ed9ff8
 F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
-F test/releasetest.tcl 13f401c10dd4fe1a2fb811ae6ed27fd7d1300d3c
+F test/releasetest.tcl a37cd82092c8be438255d65804b5951d6e3ecdae
 F test/resolver01.test 33abf37ff8335e6bf98f2b45a0af3e06996ccd9a
 F test/rollback.test 458fe73eb3ffdfdf9f6ba3e9b7350a6220414dea
 F test/rollback2.test fc14cf6d1a2b250d2735ef16124b971bce152f14
@@ -1248,7 +1248,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 5c965a71b957fdb0310ac1af9bf2fc3b418af668
-R a13de84916db5713aa965bbf949c399f
+P 5f6e35802fcf7b5e9fc3dd4424e9074523fa8ad3
+R beb5360693babbdb25b957a67e8a7b0e
 U mistachkin
-Z d93e90a8dd0c05d351cfea868c3bfa91
+Z 6aedfad85a42d725bf8ce314c14e99d1
index 15bc18f89e07692aafb9ae38eda405ece21794cb..3312a66aa238ce45e5b67e22d278164a3bbf3b83 100644 (file)
@@ -1 +1 @@
-5f6e35802fcf7b5e9fc3dd4424e9074523fa8ad3
\ No newline at end of file
+f664bfdc82597a4530d4f4938bb96557b43b171b
\ No newline at end of file
index 746fc9bb354cddfee376609419c113f9a7b77d0e..95cacf590faf7f53718fc400e214a244118641f0 100644 (file)
@@ -14,6 +14,7 @@ optional) are:
     --config   CONFIGNAME              (Run only CONFIGNAME)
     --quick                            (Run "veryquick.test" only)
     --veryquick                        (Run "make smoketest" only)
+    --msvc                             (Use MSVC as the compiler)
     --buildonly                        (Just build testfixture - do not run)
     --dryrun                           (Print what would have happened)
     --info                             (Show diagnostic info)
@@ -22,8 +23,9 @@ The default value for --srcdir is the parent of the directory holding
 this script.
 
 The script determines the default value for --platform using the
-$tcl_platform(os) and $tcl_platform(machine) variables. Supported
-platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386".
+$tcl_platform(os) and $tcl_platform(machine) variables.  Supported
+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
 of the SQLite source tree.
@@ -238,6 +240,10 @@ array set ::Platforms [strip_comments {
     "Default"                 "mptest fulltestonly"
     "Have-Not"                test
   }
+  "Windows NT-amd64" {
+    "Default"                 "mptest fulltestonly"
+    "Have-Not"                test
+  }
 
   # The Failure-Detection platform runs various tests that deliberately
   # 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
       }
     }
+    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} {
       incr ::NERRCASE
       if {$rc==0} {
@@ -314,7 +327,13 @@ proc count_tests_and_errors {logfile rcVar errmsgVar} {
     }
   }
   close $fd
-  if {!$seen} {
+  if {$::BUILDONLY} {
+    if {$rc==0} {
+      set errmsg "Build complete"
+    } else {
+      set errmsg "Build failed"
+    }
+  } elseif {!$seen} {
     set rc 1
     set errmsg "Test did not complete"
     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 is only passed to gcc.
   #
-  set cflags "-g"
+  set cflags [expr {$::MSVC ? "-Zi" : "-g"}]
   set opts ""
   set title ${name}($testtarget)
   set configOpts ""
@@ -349,7 +368,14 @@ proc run_test_suite {name testtarget config} {
 
   set cflags [join $cflags " "]
   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.
   #
@@ -390,10 +416,10 @@ proc run_test_suite {name testtarget config} {
     if {$rc} {
       puts " FAIL $tm"
       incr ::NERR
-      if {$errmsg!=""} {puts "     $errmsg"}
     } else {
       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).
 #
 proc configureCommand {opts} {
+  if {$::MSVC} return [list]; # This is not needed for MSVC.
   set result [list trace_cmd exec]
   if {$::tcl_platform(platform)=="windows"} {
     lappend result sh
@@ -414,7 +441,14 @@ proc configureCommand {opts} {
 # specified targets, compiler flags, and options.
 #
 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 {
     lappend result $target
   }
@@ -443,6 +477,7 @@ proc trace_cmd {args} {
 proc process_options {argv} {
   set ::SRCDIR    [file normalize [file dirname [file dirname $::argv0]]]
   set ::QUICK     0
+  set ::MSVC      0
   set ::BUILDONLY 0
   set ::DRYRUN    0
   set ::EXEC      exec
@@ -476,6 +511,10 @@ proc process_options {argv} {
         set config [lindex $argv $i]
       }
 
+      -msvc {
+        set ::MSVC 1
+      }
+
       -buildonly {
         set ::BUILDONLY 1
       }
@@ -494,6 +533,7 @@ proc process_options {argv} {
         puts "   --platform [list $platform]"
         puts "   --config [list $config]"
         if {$::QUICK}     {puts "   --quick"}
+        if {$::MSVC}      {puts "   --msvc"}
         if {$::BUILDONLY} {puts "   --buildonly"}
         if {$::DRYRUN}    {puts "   --dryrun"}
         if {$::TRACE}     {puts "   --trace"}
@@ -507,7 +547,15 @@ proc process_options {argv} {
         }
         exit
       }
-      -g -
+
+      -g {
+        if {$::MSVC} {
+          lappend ::EXTRACONFIG -Zi
+        } else {
+          lappend ::EXTRACONFIG [lindex $argv $i]
+        }
+      }
+
       -D* -
       -O* -
       -enable-* -
@@ -547,6 +595,7 @@ proc process_options {argv} {
   puts -nonewline "Flags:"
   if {$::DRYRUN} {puts -nonewline " --dryrun"}
   if {$::BUILDONLY} {puts -nonewline " --buildonly"}
+  if {$::MSVC} {puts -nonewline " --msvc"}
   switch -- $::QUICK {
      1 {puts -nonewline " --quick"}
      2 {puts -nonewline " --veryquick"}
@@ -570,12 +619,20 @@ proc main {argv} {
   set ::SQLITE_VERSION {}
   set STARTTIME [clock seconds]
   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"} {
       switch -- $::QUICK {
          1 {set target test}
          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]