Index: test/releasetest_data.tcl ================================================================== --- test/releasetest_data.tcl +++ test/releasetest_data.tcl @@ -385,11 +385,11 @@ lappend opts -DSQLITE_OS_UNIX=1 } # Set the sub-directory to use. # - set dir [string tolower [string map {- _ " " _} $name]] + set dir [string tolower [string map {- _ " " _ "(" _ ")" _} $name]] # Join option lists into strings, using space as delimiter. # set makeOpts [join $makeOpts " "] set cflags [join $cflags " "] Index: test/wapptest.tcl ================================================================== --- test/wapptest.tcl +++ test/wapptest.tcl @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/sh # \ exec wapptclsh "$0" ${1+"$@"} # package required wapp source [file join [file dirname [info script]] wapp.tcl] @@ -20,17 +20,18 @@ # set G(platform) $::tcl_platform(os)-$::tcl_platform(machine) set G(test) Normal set G(keep) 0 set G(msvc) 0 -set G(tcl) "" +set G(tcl) [::tcl::pkgconfig get libdir,install] set G(jobs) 3 +set G(debug) 0 proc wapptest_init {} { global G - set lSave [list platform test keep msvc tcl jobs] + set lSave [list platform test keep msvc tcl jobs debug] foreach k $lSave { set A($k) $G($k) } array unset G foreach k $lSave { set G($k) $A($k) } # The root of the SQLite source tree. @@ -42,12 +43,13 @@ set G(sqlite_version) "unknown" # Either "config", "running" or "stopped": set G(state) "config" - set G(host) "(unknown host)" - catch { set G(host) [exec hostname] } + set G(hostname) "(unknown host)" + catch { set G(hostname) [exec hostname] } + set G(host) $G(hostname) append G(host) " $::tcl_platform(os) $::tcl_platform(osVersion)" append G(host) " $::tcl_platform(machine) $::tcl_platform(byteOrder)" } # Check to see if there are uncommitted changes in the SQLite source @@ -62,10 +64,33 @@ set ret 1 } cd $pwd return $ret } + +proc generate_fossil_info {} { + global G + set pwd [pwd] + cd $G(srcdir) + if {[catch {exec fossil info} r1]} return + if {[catch {exec fossil changes} r2]} return + cd $pwd + + foreach line [split $r1 "\n"] { + if {[regexp {^checkout: *(.*)$} $line -> co]} { + wapp-trim {
%html($co) } + } + } + + if {[string trim $r2]!=""} { + wapp-trim { +
+ WARNING: Uncommitted changes in checkout + + } + } +} # If the application is in "config" state, set the contents of the # ::G(test_array) global to reflect the tests that will be run. If the # app is in some other state ("running" or "stopped"), this command # is a no-op. @@ -100,10 +125,26 @@ } } } lappend G(test_array) [dict create config $config target $target] + + set exclude [list checksymbols valgrindtest fuzzoomtest] + if {$G(debug) && !($target in $exclude)} { + set debug_idx [lsearch -glob $::Configs($config) -DSQLITE_DEBUG*] + set xtarget $target + regsub -all {fulltest[a-z]*} $xtarget test xtarget + if {$debug_idx<0} { + lappend G(test_array) [ + dict create config $config-(Debug) target $target + ] + } else { + lappend G(test_array) [ + dict create config $config-(NDebug) target $xtarget + ] + } + } } } } proc count_tests_and_errors {name logfile} { @@ -240,11 +281,30 @@ set G(test.$name.channel) $fd fconfigure $fd -blocking 0 fileevent $fd readable [list slave_fileevent $name] puts $fd [list 0 $G(msvc) 0 $G(keep)] - set L [make_test_suite $G(msvc) "" $name $target $::Configs($name)] + + set wtcl "" + if {$G(tcl)!=""} { set wtcl "--with-tcl=$G(tcl)" } + + # If this configuration is named -(Debug) or -(NDebug), + # then add or remove the SQLITE_DEBUG option from the base + # configuration before running the test. + if {[regexp -- {(.*)-(\(.*\))} $name -> head tail]} { + set opts $::Configs($head) + if {$tail=="(Debug)"} { + append opts " -DSQLITE_DEBUG=1 -DSQLITE_EXTRA_IFNULLROW=1" + } else { + regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $opts { } opts + regsub { *-DSQLITE_DEBUG[^ ]* *} $opts { } opts + } + } else { + set opts $::Configs($name) + } + + set L [make_test_suite $G(msvc) $wtcl $name $target $opts] puts $fd $L flush $fd set G(test.$name.log) [file join [lindex $L 1] test.log] incr nLaunch -1 } @@ -267,34 +327,29 @@ proc generate_main_page {{extra {}}} { global G set_test_array - # + set hostname $G(hostname) wapp-trim { + %html($hostname): wapptest.tcl } - # If the checkout contains uncommitted changs, put a warning at the top - # of the page. - if {[check_uncommitted]} { - wapp-trim { -
- WARNING: Uncommitted changes in checkout. -
- } - } - set host $G(host) wapp-trim { -
%string($host)
-
-
+
%string($host) + } + generate_fossil_info + wapp-trim { +
+
+ } # Build the "platform" select widget. set lOpt [array names ::Platforms] generate_select_widget Platform control_platform $lOpt $G(platform) @@ -334,18 +389,20 @@ + + } wapp-trim { } wapp-trim {
-
+
} wapp-page-tests set script "script/$G(state).js" wapp-trim { @@ -360,11 +417,11 @@ generate_main_page } proc wapp-page-tests {} { global G - wapp-trim { } + wapp-trim {
} foreach t $G(test_array) { set config [dict get $t config] set target [dict get $t target] set class "testwait" @@ -389,14 +446,14 @@ set seconds "$hr:$min:$sec" } wapp-trim { - -
%html($config) - %html($target) - %html($seconds) - + %html($config) + %html($target) + %html($seconds) + } if {[info exists G(test.$config.log)]} { set log $G(test.$config.log) set uri "log/$log" wapp-trim { @@ -405,12 +462,11 @@ } if {[info exists G(test.$config.errmsg)] && $G(test.$config.errmsg)!=""} { set errmsg $G(test.$config.errmsg) wapp-trim {
- %html($errmsg) + %html($errmsg) } } } wapp-trim {
} @@ -428,15 +484,15 @@ # Whenever the form at the top of the application page is submitted, it # is submitted here. # proc wapp-page-control {} { global G - catch { puts [wapp-param control_msvc] } if {$::G(state)=="config"} { - set lControls [list platform test tcl jobs keep msvc] + set lControls [list platform test tcl jobs keep msvc debug] set G(msvc) 0 set G(keep) 0 + set G(debug) 0 } else { set lControls [list jobs] } foreach v $lControls { if {[wapp-param-exists control_$v]} { @@ -480,52 +536,37 @@ # # Return the stylesheet for the application main page. # proc wapp-page-style.css {} { wapp-subst { - .div { - border: 3px groove #444444; - margin: 1em; - padding: 1em; - } + /* The boxes with black borders use this class */ .border { border: 3px groove #444444; padding: 1em; margin-top: 1em; margin-bottom: 1em; } - .div2 { - margin: 1em; - } - - table { - padding: 1em; - width:100%; - border: 3px groove #444444; - } - + /* Float to the right (used for the Run/Stop/Reset button) */ + .right { float: right; } + + /* Style for the large red warning at the top of the page */ .warning { - text-align:center; color: red; - font-size: 2em; font-weight: bold; } - .testfield { - padding-right: 10ex; - white-space: nowrap; - } - - .testwait {} - .testrunning { color: blue } - .testdone { color: green } - .testfail { color: red } - - .right { float: right; } - + /* Styles used by cells in the test table */ + .padleft { padding-left: 5ex; } + .nowrap { white-space: nowrap; } + + /* Styles for individual tests, depending on the outcome */ + .testwait { } + .testrunning { color: blue } + .testdone { color: green } + .testfail { color: red } } } # URI: /script/${state}.js # @@ -538,14 +579,15 @@ regexp {[^/]*$} [wapp-param REQUEST_URI] script set tcl $::G(tcl) set keep $::G(keep) set msvc $::G(msvc) + set debug $::G(debug) wapp-subst { var lElem = \["control_platform", "control_test", "control_msvc", - "control_jobs" + "control_jobs", "control_debug" \]; lElem.forEach(function(e) { var elem = document.getElementById(e); elem.addEventListener("change", function() { control.submit() } ); }) @@ -556,10 +598,13 @@ elem = document.getElementById("control_keep"); elem.checked = %string($keep); elem = document.getElementById("control_msvc"); elem.checked = %string($msvc); + + elem = document.getElementById("control_debug"); + elem.checked = %string($debug); } if {$script != "config.js"} { wapp-subst { var lElem = \["control_platform", "control_test",