/ Check-in [09623cc4]
Login

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

Overview
Comment:Update wapptest.tcl so that it deletes extra files if the "Keep files:" checkbox is clear. Set it by default.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 09623cc4cc82e3c123d1fd5d88b2f4b50ec5f2cc7e579a7203258bf0c246a74f
User & Date: dan 2019-05-01 15:25:38
Context
2019-05-01
15:32
Avoid unwelcomed side effects on the input operands in the OP_Concat operator. Fix for ticket [3be1295b264be2fac49b681] check-in: 713caa38 user: drh tags: trunk
15:25
Update wapptest.tcl so that it deletes extra files if the "Keep files:" checkbox is clear. Set it by default. check-in: 09623cc4 user: dan tags: trunk
14:41
In "PRAGMA vdbe_trace" output, show the results of OP_Affinity opcodes. check-in: 56604bb6 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/wapptest.tcl.

    16     16   #   G(keep)     - Boolean. True to delete no files after each test.
    17     17   #   G(msvc)     - Boolean. True to use MSVC as the compiler.
    18     18   #   G(tcl)      - Use Tcl from this directory for builds.
    19     19   #   G(jobs)     - How many sub-processes to run simultaneously.
    20     20   #
    21     21   set G(platform) $::tcl_platform(os)-$::tcl_platform(machine)
    22     22   set G(test)     Normal
    23         -set G(keep)     0
    24         -set G(msvc)     0
           23  +set G(keep)     1
           24  +set G(msvc)     [expr {$::tcl_platform(platform)=="windows"}]
    25     25   set G(tcl)      [::tcl::pkgconfig get libdir,install]
    26     26   set G(jobs)     3
    27     27   set G(debug)    0
    28     28   
    29     29   proc wapptest_init {} {
    30     30     global G
    31     31   
................................................................................
   193    193       set G(test.$name.errmsg) "Test did not complete"
   194    194       if {[file readable core]} {
   195    195         append G(test.$name.errmsg) " - core file exists"
   196    196       }
   197    197     }
   198    198   }
   199    199   
          200  +# This command is invoked once a slave process has finished running its
          201  +# tests, successfully or otherwise. Parameter $name is the name of the 
          202  +# test, $rc the exit code returned by the slave process.
          203  +#
   200    204   proc slave_test_done {name rc} {
   201    205     global G
   202    206     set G(test.$name.done) [clock seconds]
   203    207     set G(test.$name.nError) 0
   204    208     set G(test.$name.nTest) 0
   205    209     set G(test.$name.errmsg) ""
   206    210     if {$rc} {
   207    211       incr G(test.$name.nError)
   208    212     }
   209    213     if {[file exists $G(test.$name.log)]} {
   210    214       count_tests_and_errors $name $G(test.$name.log)
   211    215     }
          216  +
          217  +  # If the "keep files" checkbox is clear, delete all files except for
          218  +  # the executables and test logs. And any core file that is present.
          219  +  if {$G(keep)==0} {
          220  +    set keeplist {
          221  +      testfixture testfixture.exe
          222  +      sqlite3 sqlite3.exe
          223  +      test.log test-out.txt
          224  +      core
          225  +    }
          226  +    foreach f [glob -nocomplain [file join $G(test.$name.dir) *]] {
          227  +      set t [file tail $f]
          228  +      if {[lsearch $keeplist $t]<0} {
          229  +        catch { file delete -force $f }
          230  +      }
          231  +    }
          232  +  }
   212    233   }
   213    234   
          235  +# This is a fileevent callback invoked each time a file-descriptor that
          236  +# connects this process to a slave process is readable.
          237  +#
   214    238   proc slave_fileevent {name} {
   215    239     global G
   216    240     set fd $G(test.$name.channel)
   217    241   
   218    242     if {[eof $fd]} {
   219    243       fconfigure $fd -blocking 1
   220    244       set rc [catch { close $fd }]
................................................................................
   224    248       set line [gets $fd]
   225    249       if {[string trim $line] != ""} { puts "Trace   : $name - \"$line\"" }
   226    250     }
   227    251   
   228    252     do_some_stuff
   229    253   }
   230    254   
          255  +# Return the contents of the "slave script" - the script run by slave 
          256  +# processes to actually perform the test. It does two things:
          257  +#
          258  +#   1. Reads and [exec]s the contents of file wapptest_configure.sh.
          259  +#   2. Reads and [exec]s the contents of file wapptest_make.sh.
          260  +#
          261  +# Step 1 is omitted if the test uses MSVC (which does not use configure).
          262  +#
   231    263   proc wapptest_slave_script {} {
   232    264     global G
   233    265     set res {
   234    266       proc readfile {filename} {
   235    267         set fd [open $filename]
   236    268         set data [read $fd]
   237    269         close $fd
................................................................................
   266    298   } {
   267    299     global G
   268    300   
   269    301     catch { file mkdir $dir } msg
   270    302     foreach f [glob -nocomplain [file join $dir *]] {
   271    303       catch { file delete -force $f }
   272    304     }
          305  +  set G(test.$name.dir) $dir
   273    306   
   274    307     # Write the configure command to wapptest_configure.sh. This file
   275    308     # is empty if using MSVC - MSVC does not use configure.
   276    309     #
   277    310     set fd1 [open [file join $dir wapptest_configure.sh] w]
   278    311     if {$G(msvc)==0} {
   279    312       puts $fd1 "[file join .. $G(srcdir) configure] $wtcl $configOpts"