/ Check-in [559c2dd6]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update "releasetest_data.tcl" so that it is a standalone script that generates sh or batch scripts to run each tcl test run at release time. Update wapptest.tcl to use it.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 559c2dd6724b2fc238760863d4be7132b591457e72ca5758fdd4002fbf7df4bc
User & Date: dan 2019-07-31 21:08:55
Context
2019-08-01
10:58
Fix a problem in ALTER TABLE triggered by views or triggers that include the construction "ORDER BY true" or "ORDER BY false". check-in: 8168021f user: dan tags: trunk
2019-07-31
21:08
Update "releasetest_data.tcl" so that it is a standalone script that generates sh or batch scripts to run each tcl test run at release time. Update wapptest.tcl to use it. check-in: 559c2dd6 user: dan tags: trunk
15:16
New test cases in test/fuzzdata8.db. check-in: 6e92d71c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/releasetest_data.tcl.

     1      1   
     2      2   # This file contains Configuration data used by "wapptest.tcl" and
     3      3   # "releasetest.tcl".
     4      4   #
            5  +set USAGE {
            6  +$argv0 configurations
            7  +    List available configurations.
            8  +
            9  +$argv0 script ?-msvc? CONFIGURATION TARGET
           10  +    Given a configuration and make target, return a bash (or, if -msvc
           11  +    is specified, batch) script to execute the test. The first argument
           12  +    passed to the script must be a directory containing SQLite source code.
           13  +
           14  +$argv0 platforms
           15  +    List available platforms.
           16  +
           17  +$argv0 tests ?-nodebug? PLATFORM
           18  +    List tests in a specified platform. If the -nodebug switch is 
           19  +    specified, synthetic debug/ndebug configurations are omitted.
           20  +}
     5     21   
     6     22   # Omit comments (text between # and \n) in a long multi-line string.
     7     23   #
     8     24   proc strip_comments {in} {
     9     25     regsub -all {#[^\n]*\n} $in {} out
    10     26     return $out
    11     27   }
................................................................................
   154    170     "Apple" {
   155    171       -Os
   156    172       -DHAVE_GMTIME_R=1
   157    173       -DHAVE_ISNAN=1
   158    174       -DHAVE_LOCALTIME_R=1
   159    175       -DHAVE_PREAD=1
   160    176       -DHAVE_PWRITE=1
   161         -    -DHAVE_USLEEP=1
   162         -    -DHAVE_USLEEP=1
   163    177       -DHAVE_UTIME=1
   164    178       -DSQLITE_DEFAULT_CACHE_SIZE=1000
   165    179       -DSQLITE_DEFAULT_CKPTFULLFSYNC=1
   166    180       -DSQLITE_DEFAULT_MEMSTATUS=1
   167    181       -DSQLITE_DEFAULT_PAGE_SIZE=1024
   168    182       -DSQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS=1
   169    183       -DSQLITE_ENABLE_API_ARMOR=1
   170    184       -DSQLITE_ENABLE_AUTO_PROFILE=1
   171    185       -DSQLITE_ENABLE_FLOCKTIMEOUT=1
   172    186       -DSQLITE_ENABLE_FTS3=1
   173    187       -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
   174    188       -DSQLITE_ENABLE_FTS3_TOKENIZER=1
   175         -    if:os=="Darwin" -DSQLITE_ENABLE_LOCKING_STYLE=1
   176    189       -DSQLITE_ENABLE_PERSIST_WAL=1
   177    190       -DSQLITE_ENABLE_PURGEABLE_PCACHE=1
   178    191       -DSQLITE_ENABLE_RTREE=1
   179    192       -DSQLITE_ENABLE_SNAPSHOT=1
   180    193       # -DSQLITE_ENABLE_SQLLOG=1
   181    194       -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
   182    195       -DSQLITE_MAX_LENGTH=2147483645
................................................................................
   208    221       -DSQLITE_DISABLE_FTS4_DEFERRED
   209    222       -DSQLITE_ENABLE_RTREE
   210    223       --enable-json1 --enable-fts5
   211    224     }
   212    225     "No-lookaside" {
   213    226       -DSQLITE_TEST_REALLOC_STRESS=1
   214    227       -DSQLITE_OMIT_LOOKASIDE=1
   215         -    -DHAVE_USLEEP=1
   216    228     }
   217    229     "Valgrind" {
   218    230       -DSQLITE_ENABLE_STAT4
   219    231       -DSQLITE_ENABLE_FTS4
   220    232       -DSQLITE_ENABLE_RTREE
   221    233       -DSQLITE_ENABLE_HIDDEN_COLUMNS
   222    234       --enable-json1
................................................................................
   230    242     Fail0 {-O0}
   231    243     Fail2 {-O0}
   232    244     Fail3 {-O0}
   233    245     Fail4 {-O0}
   234    246     FuzzFail1 {-O0}
   235    247     FuzzFail2 {-O0}
   236    248   }]
          249  +if {$tcl_platform(os)=="Darwin"} {
          250  +  lappend Configs(Apple -DSQLITE_ENABLE_LOCKING_STYLE=1
          251  +}
   237    252   
   238    253   array set ::Platforms [strip_comments {
   239    254     Linux-x86_64 {
   240    255       "Check-Symbols"           checksymbols
   241    256       "Fast-One"                "fuzztest test"
   242    257       "Debug-One"               "mptest test"
   243    258       "Have-Not"                test
................................................................................
   295    310       Fail3     "TEST_FAILURE=3 valgrindtest"
   296    311       Fail4     "TEST_FAILURE=4 test"
   297    312       FuzzFail1 "TEST_FAILURE=5 test"
   298    313       FuzzFail2 "TEST_FAILURE=5 valgrindtest"
   299    314     }
   300    315   }]
   301    316   
   302         -proc make_test_suite {msvc withtcl name testtarget config} {
   303         -
   304         -  # Tcl variable $opts is used to build up the value used to set the
   305         -  # OPTS Makefile variable. Variable $cflags holds the value for
   306         -  # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but
   307         -  # CFLAGS is only passed to gcc.
   308         -  #
   309         -  set makeOpts ""
   310         -  set cflags [expr {$msvc ? "-Zi" : "-g"}]
   311         -  set opts ""
   312         -  set title ${name}($testtarget)
   313         -  set configOpts $withtcl
   314         -  set skip 0
   315         -
   316         -  regsub -all {#[^\n]*\n} $config \n config
   317         -  foreach arg $config {
   318         -    if {$skip} {
   319         -      set skip 0
   320         -      continue
   321         -    }
   322         -    if {[regexp {^-[UD]} $arg]} {
   323         -      lappend opts $arg
   324         -    } elseif {[regexp {^[A-Z]+=} $arg]} {
   325         -      lappend testtarget $arg
   326         -    } elseif {[regexp {^if:([a-z]+)(.*)} $arg all key tail]} {
   327         -      # Arguments of the form 'if:os=="Linux"' will cause the subsequent
   328         -      # argument to be skipped if the $tcl_platform(os) is not "Linux", for
   329         -      # example...
   330         -      set skip [expr !(\$::tcl_platform($key)$tail)]
   331         -    } elseif {[regexp {^--(enable|disable)-} $arg]} {
   332         -      if {$msvc} {
   333         -        if {$arg eq "--disable-amalgamation"} {
   334         -          lappend makeOpts USE_AMALGAMATION=0
   335         -          continue
   336         -        }
   337         -        if {$arg eq "--disable-shared"} {
   338         -          lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0
   339         -          continue
   340         -        }
   341         -        if {$arg eq "--enable-fts5"} {
   342         -          lappend opts -DSQLITE_ENABLE_FTS5
   343         -          continue
   344         -        }
   345         -        if {$arg eq "--enable-json1"} {
   346         -          lappend opts -DSQLITE_ENABLE_JSON1
   347         -          continue
   348         -        }
   349         -        if {$arg eq "--enable-shared"} {
   350         -          lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1
   351         -          continue
   352         -        }
   353         -      }
   354         -      lappend configOpts $arg
   355         -    } else {
   356         -      if {$msvc} {
   357         -        if {$arg eq "-g"} {
   358         -          lappend cflags -Zi
   359         -          continue
   360         -        }
   361         -        if {[regexp -- {^-O(\d+)$} $arg all level]} then {
   362         -          lappend makeOpts OPTIMIZATIONS=$level
   363         -          continue
   364         -        }
   365         -      }
   366         -      lappend cflags $arg
   367         -    }
   368         -  }
   369         -
   370         -  # Disable sync to make testing faster.
   371         -  #
   372         -  lappend opts -DSQLITE_NO_SYNC=1
   373         -
   374         -  # Some configurations already set HAVE_USLEEP; in that case, skip it.
   375         -  #
   376         -  if {[lsearch -regexp $opts {^-DHAVE_USLEEP(?:=|$)}]==-1} {
   377         -    lappend opts -DHAVE_USLEEP=1
   378         -  }
   379         -
   380         -  # Add the define for this platform.
   381         -  #
   382         -  if {$::tcl_platform(platform)=="windows"} {
   383         -    lappend opts -DSQLITE_OS_WIN=1
   384         -  } else {
   385         -    lappend opts -DSQLITE_OS_UNIX=1
   386         -  }
   387         -
   388         -  # Set the sub-directory to use.
   389         -  #
   390         -  set dir [string tolower [string map {- _ " " _ "(" _ ")" _} $name]]
   391         -
   392         -  # Join option lists into strings, using space as delimiter.
   393         -  #
   394         -  set makeOpts [join $makeOpts " "]
   395         -  set cflags   [join $cflags " "]
   396         -  set opts     [join $opts " "]
   397         -
   398         -  return [list $title $dir $configOpts $testtarget $makeOpts $cflags $opts]
   399         -}
   400         -
   401    317   # Configuration verification: Check that each entry in the list of configs
   402    318   # specified for each platforms exists.
   403    319   #
   404    320   foreach {key value} [array get ::Platforms] {
   405    321     foreach {v t} $value {
   406    322       if {0==[info exists ::Configs($v)]} {
   407    323         puts stderr "No such configuration: \"$v\""
   408    324         exit -1
   409    325       }
   410    326     }
   411    327   }
          328  +
          329  +proc usage {} {
          330  +  global argv0
          331  +  puts stderr [subst $::USAGE]
          332  +  exit 1
          333  +}
          334  +
          335  +proc is_prefix {p str min} {
          336  +  set n [string length $p]
          337  +  if {$n<$min} { return 0 }
          338  +  if {[string range $str 0 [expr $n-1]]!=$p} { return 0 }
          339  +  return 1
          340  +}
          341  +
          342  +proc main_configurations {} {
          343  +  foreach k [lsort [array names ::Configs]] {
          344  +    puts $k
          345  +  }
          346  +}
          347  +
          348  +proc main_platforms {} {
          349  +  foreach k [lsort [array names ::Platforms]] {
          350  +    puts "\"$k\""
          351  +  }
          352  +}
          353  +
          354  +proc main_script {args} {
          355  +  set bMsvc 0
          356  +  set nArg [llength $args]
          357  +  if {$nArg==3} {
          358  +    if {![is_prefix [lindex $args 0] -msvc 2]} usage
          359  +    set bMsvc 1
          360  +  } elseif {$nArg<2 || $nArg>3} {
          361  +    usage
          362  +  }
          363  +  set config [lindex $args end-1]
          364  +  set target [lindex $args end]
          365  +
          366  +  set opts       [list]                         ;# OPTS value
          367  +  set cflags     [expr {$bMsvc ? "-Zi" : "-g"}] ;# CFLAGS value
          368  +  set makeOpts   [list]                         ;# Extra args for [make]
          369  +  set configOpts [list]                         ;# Extra args for [configure]
          370  +
          371  +  if {$::tcl_platform(platform)=="windows"} {
          372  +    lappend opts -DSQLITE_OS_WIN=1
          373  +  } else {
          374  +    lappend opts -DSQLITE_OS_UNIX=1
          375  +  }
          376  +
          377  +  # Figure out if this is a synthetic ndebug or debug configuration.
          378  +  #
          379  +  set bRemoveDebug 0
          380  +  if {[string match *-ndebug $config]} {
          381  +    set bRemoveDebug 1
          382  +    set config [string range $config 0 end-7]
          383  +  }
          384  +  if {[string match *-debug $config]} {
          385  +    lappend opts -DSQLITE_DEBUG
          386  +    lappend opts -DSQLITE_EXTRA_IFNULLROW
          387  +    set config [string range $config 0 end-6]
          388  +  }
          389  +
          390  +  # Ensure that the named configuration exists.
          391  +  #
          392  +  if {![info exists ::Configs($config)]} {
          393  +    puts stderr "No such config: $config"
          394  +    exit 1
          395  +  }
          396  +
          397  +  # Loop through the parameters of the nominated configuration, updating
          398  +  # $opts, $cflags, $makeOpts and $configOpts along the way. Rules are as
          399  +  # follows:
          400  +  #
          401  +  #   1. If $bRemoveDebug is set and the parameter is -DSQLITE_DEBUG or
          402  +  #      -DSQLITE_DEBUG=1, discard it.
          403  +  #
          404  +  #   2. If the parameter begins with "-D", add it to $opts.
          405  +  #
          406  +  #   3. If the parameter begins with "--" add it to $configOpts. Unless
          407  +  #      this command is preparing a script for MSVC - then add an 
          408  +  #      equivalent to $makeOpts or $opts.
          409  +  #
          410  +  #   4. If the parameter begins with "-" add it to $cflags. If in MSVC
          411  +  #      mode and the parameter is an -O<integer> option, instead add
          412  +  #      an OPTIMIZATIONS=<integer> switch to $makeOpts.
          413  +  #
          414  +  #   5. If none of the above apply, add the parameter to $makeOpts
          415  +  #
          416  +  foreach param $::Configs($config) {
          417  +    if {$bRemoveDebug} {
          418  +      if {$param=="-DSQLITE_DEBUG" || $param=="-DSQLITE_DEBUG=1"
          419  +       || $param=="-DSQLITE_MEMDEBUG" || $param=="-DSQLITE_MEMDEBUG=1"
          420  +      } {
          421  +        continue
          422  +      }
          423  +    }
          424  +
          425  +    if {[string range $param 0 1]=="-D"} {
          426  +      lappend opts $param
          427  +      continue
          428  +    }
          429  +
          430  +    if {[string range $param 0 1]=="--"} {
          431  +      if {$bMsvc} {
          432  +        switch -- $param {
          433  +          --disable-amalgamation {
          434  +            lappend makeOpts USE_AMALGAMATION=0
          435  +          }
          436  +          --disable-shared {
          437  +            lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0
          438  +          }
          439  +          --enable-fts5 {
          440  +            lappend opts -DSQLITE_ENABLE_FTS5
          441  +          } 
          442  +          --enable-json1 {
          443  +            lappend opts -DSQLITE_ENABLE_JSON1
          444  +          } 
          445  +          --enable-shared {
          446  +            lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1
          447  +          }
          448  +          --enable-session {
          449  +            lappend opts -DSQLITE_ENABLE_PREUPDATE_HOOK
          450  +            lappend opts -DSQLITE_ENABLE_SESSION
          451  +          }
          452  +          default {
          453  +            error "Cannot translate $param for MSVC"
          454  +          }
          455  +        }
          456  +      } else {
          457  +        lappend configOpts $param
          458  +      }
          459  +
          460  +      continue
          461  +    }
          462  +
          463  +    if {[string range $param 0 0]=="-"} {
          464  +      if {$bMsvc && [regexp -- {^-O(\d+)$} $param -> level]} {
          465  +        lappend makeOpts OPTIMIZATIONS=$level
          466  +      } else {
          467  +        lappend cflags $param
          468  +      }
          469  +      continue
          470  +    }
          471  +
          472  +    lappend makeOpts $param
          473  +  }
          474  +
          475  +  # Some configurations specify -DHAVE_USLEEP=0. For all others, add
          476  +  # -DHAVE_USLEEP=1.
          477  +  #
          478  +  if {[lsearch $opts "-DHAVE_USLEEP=0"]<0} {
          479  +    lappend opts -DHAVE_USLEEP=1
          480  +  }
          481  +
          482  +  if {$bMsvc==0} {
          483  +    puts {set -e}
          484  +    puts {}
          485  +    puts {if [ "$#" -ne 1 ] ; then}
          486  +    puts {  echo "Usage: $0 <sqlite-src-dir>" }
          487  +    puts {  exit -1 }
          488  +    puts {fi }
          489  +    puts {SRCDIR=$1}
          490  +    puts {}
          491  +    puts "TCL=\"[::tcl::pkgconfig get libdir,install]\""
          492  +
          493  +    puts "\$SRCDIR/configure --with-tcl=\$TCL $configOpts"
          494  +    puts {}
          495  +    puts {OPTS="      -DSQLITE_NO_SYNC=1"}
          496  +    foreach o $opts { 
          497  +      puts "OPTS=\"\$OPTS $o\"" 
          498  +    }
          499  +    puts {}
          500  +    puts "CFLAGS=\"$cflags\""
          501  +    puts {}
          502  +    puts "make $target \"CFLAGS=\$CFLAGS\" \"OPTS=\$OPTS\" $makeOpts"
          503  +  } else {
          504  +
          505  +    puts {set SRCDIR=%1}
          506  +    set makecmd    "nmake /f %SRCDIR%\\Makefile.msc TOP=%SRCDIR% $target "
          507  +    append makecmd "\"CFLAGS=$cflags\" \"OPTS=$opts\" $makeOpts"
          508  +
          509  +    puts $makecmd
          510  +  }
          511  +}
          512  +
          513  +proc main_tests {args} {
          514  +  set bNodebug 0
          515  +  set nArg [llength $args]
          516  +  if {$nArg==2} {
          517  +    if {[is_prefix [lindex $args 0] -nodebug 2]} {
          518  +      set bNodebug 1
          519  +    } elseif {[is_prefix [lindex $args 0] -debug 2]} {
          520  +      set bNodebug 0
          521  +    } else usage
          522  +  } elseif {$nArg==0 || $nArg>2} {
          523  +    usage
          524  +  }
          525  +  set p [lindex $args end]
          526  +  if {![info exists ::Platforms($p)]} {
          527  +    puts stderr "No such platform: $p"
          528  +    exit 1
          529  +  }
          530  +
          531  +  foreach {config target} $::Platforms($p) {
          532  +    puts "$config \"$target\""
          533  +    if {$bNodebug==0} {
          534  +      if {$target!="checksymbols" && $target!="valgrindtest" 
          535  +       && $target!="fuzzoomtest"
          536  +      } {
          537  +        set iHas [string first SQLITE_DEBUG $::Configs($config)]
          538  +        if {$iHas>=0} {
          539  +          puts "$config-ndebug \"test\""
          540  +        } else {
          541  +          puts "$config-debug \"test\""
          542  +        }
          543  +      }
          544  +    }
          545  +  }
          546  +}
          547  +
          548  +if {[llength $argv]==0} { usage }
          549  +set cmd [lindex $argv 0]
          550  +set n [expr [llength $argv]-1]
          551  +if {[string match ${cmd}* configurations] && $n==0} {
          552  +  main_configurations 
          553  +} elseif {[string match ${cmd}* script]} {
          554  +  main_script {*}[lrange $argv 1 end]
          555  +} elseif {[string match ${cmd}* platforms] && $n==0} {
          556  +  main_platforms
          557  +} elseif {[string match ${cmd}* tests]} {
          558  +  main_tests {*}[lrange $argv 1 end]
          559  +} else {
          560  +  usage
          561  +}
          562  +
   412    563   

Changes to test/wapptest.tcl.

     1      1   #!/bin/sh
     2      2   # \
     3      3   exec wapptclsh "$0" ${1+"$@"}
     4      4   
     5      5   # package required wapp
     6      6   source [file join [file dirname [info script]] wapp.tcl]
     7      7   
     8         -# Read the data from the releasetest_data.tcl script.
     9         -#
    10         -source [file join [file dirname [info script]] releasetest_data.tcl]
    11         -
    12      8   # Variables set by the "control" form:
    13      9   #
    14     10   #   G(platform) - User selected platform.
    15     11   #   G(test)     - Set to "Normal", "Veryquick", "Smoketest" or "Build-Only".
    16     12   #   G(keep)     - Boolean. True to delete no files after each test.
    17     13   #   G(msvc)     - Boolean. True to use MSVC as the compiler.
    18     14   #   G(tcl)      - Use Tcl from this directory for builds.
................................................................................
    64     60     foreach t $G(test_array) {
    65     61       set config [dict get $t config]
    66     62       set target [dict get $t target]
    67     63       wapptest_output [format "    %-25s%s" $config $target]
    68     64     }
    69     65     wapptest_output [string repeat * 70]
    70     66   }
           67  +
           68  +proc releasetest_data {args} {
           69  +  global G
           70  +  set rtd [file join $G(srcdir) test releasetest_data.tcl]
           71  +  set fd [open "|[info nameofexecutable] $rtd $args" r+]
           72  +  set ret [read $fd]
           73  +  close $fd
           74  +  return $ret
           75  +}
    71     76   
    72     77   # Generate the text for the box at the top of the UI. The current SQLite
    73     78   # version, according to fossil, along with a warning if there are 
    74     79   # uncommitted changes in the checkout.
    75     80   #
    76     81   proc generate_fossil_info {} {
    77     82     global G
................................................................................
   104    109   # app is in some other state ("running" or "stopped"), this command
   105    110   # is a no-op.
   106    111   #
   107    112   proc set_test_array {} {
   108    113     global G
   109    114     if { $G(state)=="config" } {
   110    115       set G(test_array) [list]
   111         -    foreach {config target} $::Platforms($G(platform)) {
          116  +    set debug "-debug"
          117  +    if {$G(debug)==0} { set debug "-nodebug"}
          118  +    foreach {config target} [releasetest_data tests $debug $G(platform)] {
   112    119   
   113    120         # If using MSVC, do not run sanitize or valgrind tests. Or the
   114    121         # checksymbols test.
   115    122         if {$G(msvc) && (
   116    123             "Sanitize" == $config 
   117    124          || "checksymbols" in $target
   118    125          || "valgrindtest" in $target
................................................................................
   132    139                 set target testfixture.exe
   133    140               }
   134    141             }
   135    142           }
   136    143         }
   137    144   
   138    145         lappend G(test_array) [dict create config $config target $target]
   139         -
   140         -      set exclude [list checksymbols valgrindtest fuzzoomtest]
   141         -      if {$G(debug) && !($target in $exclude)} {
   142         -        set debug_idx [lsearch -glob $::Configs($config) -DSQLITE_DEBUG*]
   143         -        set xtarget $target
   144         -        regsub -all {fulltest[a-z]*} $xtarget test xtarget
   145         -        if {$debug_idx<0} {
   146         -          lappend G(test_array) [
   147         -            dict create config $config-(Debug) target $xtarget
   148         -          ]
   149         -        } else {
   150         -          lappend G(test_array) [
   151         -            dict create config $config-(NDebug) target $xtarget
   152         -          ]
   153         -        }
   154         -      }
   155    146       }
   156    147     }
   157    148   }
   158    149   
   159    150   proc count_tests_and_errors {name logfile} {
   160    151     global G
   161    152   
................................................................................
   318    309   #   1. Reads and [exec]s the contents of file wapptest_configure.sh.
   319    310   #   2. Reads and [exec]s the contents of file wapptest_make.sh.
   320    311   #
   321    312   # Step 1 is omitted if the test uses MSVC (which does not use configure).
   322    313   #
   323    314   proc wapptest_slave_script {} {
   324    315     global G
   325         -  set res {
   326         -    proc readfile {filename} {
   327         -      set fd [open $filename]
   328         -      set data [read $fd]
   329         -      close $fd
   330         -      return $data
   331         -    }
          316  +  if {$G(msvc)==0} {
          317  +    set dir [file join .. $G(srcdir)]
          318  +    set res [subst -nocommands {
          319  +      set rc [catch "exec sh wapptest_cmd.sh {$dir} >>& test.log" ]
          320  +      exit [set rc]
          321  +    }]
          322  +  } else {
          323  +    set dir [file nativename [file normalize $G(srcdir)]]
          324  +    set dir [string map [list "\\" "\\\\"] $dir]
          325  +    set res [subst -nocommands {
          326  +      set rc [catch "exec wapptest_cmd.bat {$dir} >>& test.log" ]
          327  +      exit [set rc]
          328  +    }]
   332    329     }
   333    330   
   334         -  if {$G(msvc)==0} { 
   335         -    append res {
   336         -      set cfg  [readfile wapptest_configure.sh]
   337         -      set rc [catch { exec {*}$cfg >& test.log } msg]
   338         -      if {$rc==0} {
   339         -        set make [readfile wapptest_make.sh]
   340         -        set rc [catch { exec {*}$make >>& test.log }]
   341         -      }
   342         -    } 
   343         -  } else { 
   344         -    append res {
   345         -      set make [readfile wapptest_make.sh]
   346         -      set rc [catch { exec {*}$make >>& test.log }]
   347         -    }
   348         -  }
   349         -
   350         -  append res { exit $rc }
   351         -
   352    331     set res
   353    332   }
   354    333   
   355    334   
   356    335   # Launch a slave process to run a test.
   357    336   #
   358         -proc slave_launch {
   359         -  name wtcl title dir configOpts testtarget makeOpts cflags opts
   360         -} {
          337  +proc slave_launch {name target dir} {
   361    338     global G
   362    339   
   363    340     catch { file mkdir $dir } msg
   364    341     foreach f [glob -nocomplain [file join $dir *]] {
   365    342       catch { file delete -force $f }
   366    343     }
   367    344     set G(test.$name.dir) $dir
   368    345   
   369         -  # Write the configure command to wapptest_configure.sh. This file
   370         -  # is empty if using MSVC - MSVC does not use configure.
          346  +  # Write the test command to wapptest_cmd.sh|bat.
   371    347     #
   372         -  set fd1 [open [file join $dir wapptest_configure.sh] w]
   373         -  if {$G(msvc)==0} {
   374         -    puts $fd1 "[file join .. $G(srcdir) configure] $wtcl $configOpts"
          348  +  set ext sh
          349  +  if {$G(msvc)} { set ext bat }
          350  +  set fd1 [open [file join $dir wapptest_cmd.$ext] w]
          351  +  if {$G(msvc)} {
          352  +    puts $fd1 [releasetest_data script -msvc $name $target]
          353  +  } else {
          354  +    puts $fd1 [releasetest_data script $name $target]
   375    355     }
   376    356     close $fd1
   377    357   
   378         -  # Write the make command to wapptest_make.sh. Using nmake for MSVC and
   379         -  # make for all other systems.
   380         -  #
   381         -  set makecmd "make"
   382         -  if {$G(msvc)} { 
   383         -    set nativedir [file nativename $G(srcdir)]
   384         -    set nativedir [string map [list "\\" "\\\\"] $nativedir]
   385         -    set makecmd "nmake /f [file join $nativedir Makefile.msc] TOP=$nativedir"
   386         -  }
   387         -  set fd2 [open [file join $dir wapptest_make.sh] w]
   388         -  puts $fd2 "$makecmd $makeOpts $testtarget \"CFLAGS=$cflags\" \"OPTS=$opts\""
   389         -  close $fd2
   390         -
   391    358     # Write the wapptest_run.tcl script to the test directory. To run the
   392    359     # commands in the other two files.
   393    360     #
   394    361     set fd3 [open [file join $dir wapptest_run.tcl] w]
   395    362     puts $fd3 [wapptest_slave_script]
   396    363     close $fd3
   397    364   
................................................................................
   444    411         if {$nLaunch<=0} break
   445    412         set name [dict get $j config]
   446    413         if { ![info exists G(test.$name.channel)]
   447    414           && ![info exists G(test.$name.done)]
   448    415         } {
   449    416   
   450    417           set target [dict get $j target]
          418  +        set dir [string tolower [string map {" " _ "-" _} $name]]
   451    419           set G(test.$name.start) [clock seconds]
   452         -        set wtcl ""
   453         -        if {$G(tcl)!=""} { set wtcl "--with-tcl=$G(tcl)" }
          420  +        set G(test.$name.log) [file join $dir test.log]
   454    421   
   455         -        # If this configuration is named <name>-(Debug) or <name>-(NDebug),
   456         -        # then add or remove the SQLITE_DEBUG option from the base
   457         -        # configuration before running the test.
   458         -        if {[regexp -- {(.*)-(\(.*\))} $name -> head tail]} {
   459         -          set opts $::Configs($head)
   460         -          if {$tail=="(Debug)"} {
   461         -            append opts " -DSQLITE_DEBUG=1 -DSQLITE_EXTRA_IFNULLROW=1"
   462         -          } else {
   463         -            regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $opts { } opts
   464         -            regsub { *-DSQLITE_DEBUG[^ ]* *} $opts { } opts
   465         -          }
   466         -        } else {
   467         -          set opts $::Configs($name)
   468         -        }
          422  +        slave_launch $name $target $dir
   469    423   
   470         -        set L [make_test_suite $G(msvc) $wtcl $name $target $opts]
   471         -        set G(test.$name.log) [file join [lindex $L 1] test.log]
   472         -        slave_launch $name $wtcl {*}$L
   473         -
   474         -        set G(test.$name.log) [file join [lindex $L 1] test.log]
   475    424           incr nLaunch -1
   476    425         }
   477    426       }
   478    427     }
   479    428   }
   480    429   
   481    430   proc generate_select_widget {label id lOpt opt} {
................................................................................
   513    462     wapp-trim {
   514    463       </div>
   515    464       <div class="border" id=controls> 
   516    465       <form action="control" method="post" name="control">
   517    466     }
   518    467   
   519    468     # Build the "platform" select widget. 
   520         -  set lOpt [array names ::Platforms]
          469  +  set lOpt [releasetest_data platforms]
   521    470     generate_select_widget Platform control_platform $lOpt $G(platform)
   522    471   
   523    472     # Build the "test" select widget. 
   524    473     set lOpt [list Normal Veryquick Smoketest Build-Only] 
   525    474     generate_select_widget Test control_test $lOpt $G(test)
   526    475   
   527    476     # Build the "jobs" select widget. Options are 1 to 8.
................................................................................
   882    831   
   883    832   for {set i 0} {$i < [llength $lTestArg]} {incr i} {
   884    833     switch -- [lindex $lTestArg $i] {
   885    834       -platform {
   886    835         if {$i==[llength $lTestArg]-1} { wapptest_usage }
   887    836         incr i
   888    837         set arg [lindex $lTestArg $i]
   889         -      set lPlatform [array names ::Platforms]
          838  +      set lPlatform [releasetest_data platforms]
   890    839         if {[lsearch $lPlatform $arg]<0} {
   891    840           puts stderr "No such platform: $arg. Platforms are: $lPlatform"
   892    841           exit -1
   893    842         }
   894    843         set G(platform) $arg
   895    844       }
   896    845