1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Merge all of the latest trunk changes into the sessions branch.

FossilOrigin-Name: a9bcb432f58b96f079a73c456efd4851c582221e
This commit is contained in:
drh
2012-01-05 13:02:36 +00:00
116 changed files with 6362 additions and 1967 deletions

View File

@ -57,7 +57,7 @@
# Commands providing a lower level interface to the global test counters:
#
# set_test_counter COUNTER ?VALUE?
# omit_test TESTNAME REASON
# omit_test TESTNAME REASON ?APPEND?
# fail_test TESTNAME
# incr_ntest
#
@ -274,6 +274,7 @@ if {[info exists cmdlinearg]==0} {
# --file-retries=N
# --file-retry-delay=N
# --start=[$permutation:]$testfile
# --match=$pattern
#
set cmdlinearg(soft-heap-limit) 0
set cmdlinearg(maxerror) 1000
@ -283,7 +284,8 @@ if {[info exists cmdlinearg]==0} {
set cmdlinearg(soak) 0
set cmdlinearg(file-retries) 0
set cmdlinearg(file-retry-delay) 0
set cmdlinearg(start) ""
set cmdlinearg(start) ""
set cmdlinearg(match) ""
set leftover [list]
foreach a $argv {
@ -336,6 +338,12 @@ if {[info exists cmdlinearg]==0} {
}
if {$::G(start:file) == ""} {unset ::G(start:file)}
}
{^-+match=.+$} {
foreach {dummy cmdlinearg(match)} [split $a =] break
set ::G(match) $cmdlinearg(match)
if {$::G(match) == ""} {unset ::G(match)}
}
default {
lappend leftover $a
}
@ -414,9 +422,11 @@ if {0==[info exists ::SLAVE]} {
# Record the fact that a sequence of tests were omitted.
#
proc omit_test {name reason} {
proc omit_test {name reason {append 1}} {
set omitList [set_test_counter omit_list]
lappend omitList [list $name $reason]
if {$append} {
lappend omitList [list $name $reason]
}
set_test_counter omit_list $omitList
}
@ -471,14 +481,20 @@ proc do_test {name cmd expected} {
incr_ntest
puts -nonewline $name...
flush stdout
if {[catch {uplevel #0 "$cmd;\n"} result]} {
puts "\nError: $result"
fail_test $name
} elseif {[string compare $result $expected]} {
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
fail_test $name
if {![info exists ::G(match)] || [string match $::G(match) $name]} {
if {[catch {uplevel #0 "$cmd;\n"} result]} {
puts "\nError: $result"
fail_test $name
} elseif {[string compare $result $expected]} {
puts "\nExpected: \[$expected\]\n Got: \[$result\]"
fail_test $name
} else {
puts " Ok"
}
} else {
puts " Ok"
puts " Omitted"
omit_test $name "pattern mismatch" 0
}
flush stdout
}