mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Sync this branch with the latest trunk.
FossilOrigin-Name: 7a44fa5a350a3f19b8e9f5196d22535788885f8c0e849572202bf64a055ddc2d
This commit is contained in:
@@ -86,9 +86,10 @@ proc test_set {args} {
|
||||
#
|
||||
set alltests [list]
|
||||
foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
|
||||
foreach f [glob -nocomplain \
|
||||
$testdir/../ext/rtree/*.test \
|
||||
foreach f [glob -nocomplain \
|
||||
$testdir/../ext/rtree/*.test \
|
||||
$testdir/../ext/fts5/test/*.test \
|
||||
$testdir/../ext/expert/*.test \
|
||||
$testdir/../ext/lsm1/test/*.test \
|
||||
] {
|
||||
lappend alltests $f
|
||||
@@ -104,7 +105,7 @@ set alltests [test_set $alltests -exclude {
|
||||
all.test async.test quick.test veryquick.test
|
||||
memleak.test permutations.test soak.test fts3.test
|
||||
mallocAll.test rtree.test full.test extraquick.test
|
||||
session.test
|
||||
session.test rbu.test
|
||||
}]
|
||||
|
||||
set allquicktests [test_set $alltests -exclude {
|
||||
@@ -121,7 +122,7 @@ set allquicktests [test_set $alltests -exclude {
|
||||
vtab_err.test walslow.test walcrash.test walcrash3.test
|
||||
walthread.test rtree3.test indexfault.test securedel2.test
|
||||
sort3.test sort4.test fts4growth.test fts4growth2.test
|
||||
bigsort.test rbu.test walprotocol.test mmap4.test fuzzer2.test
|
||||
bigsort.test walprotocol.test mmap4.test fuzzer2.test
|
||||
walcrash2.test e_fkey.test backup.test
|
||||
|
||||
fts4merge.test fts4merge2.test fts4merge4.test fts4check.test
|
||||
@@ -194,7 +195,7 @@ test_suite "valgrind" -prefix "" -description {
|
||||
} -files [
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* *_err* wal.test \
|
||||
shell*.test crash8.test atof1.test selectG.test \
|
||||
tkt-fc62af4523.test numindex1.test
|
||||
tkt-fc62af4523.test numindex1.test corruptK.test
|
||||
] -initialize {
|
||||
set ::G(valgrind) 1
|
||||
} -shutdown {
|
||||
@@ -254,6 +255,7 @@ test_suite "fts3" -prefix "" -description {
|
||||
fts3am.test fts3an.test fts3ao.test fts3atoken.test
|
||||
fts3auto.test fts3aux1.test fts3aux2.test fts3b.test
|
||||
fts3comp1.test fts3conf.test fts3corrupt2.test fts3corrupt.test
|
||||
fts3corrupt4.test
|
||||
fts3cov.test fts3c.test fts3defer2.test fts3defer3.test
|
||||
fts3defer.test fts3drop.test fts3d.test fts3e.test
|
||||
fts3expr2.test fts3expr3.test fts3expr4.test fts3expr5.test
|
||||
@@ -282,6 +284,12 @@ test_suite "fts5-light" -prefix "" -description {
|
||||
-exclude *corrupt* *fault* *big* *fts5aj*
|
||||
]
|
||||
|
||||
test_suite "window" -prefix "" -description {
|
||||
All window function related tests .
|
||||
} -files [
|
||||
test_set [glob -nocomplain $::testdir/window*.test]
|
||||
]
|
||||
|
||||
test_suite "lsm1" -prefix "" -description {
|
||||
All LSM1 tests.
|
||||
} -files [glob -nocomplain $::testdir/../ext/lsm1/test/*.test]
|
||||
@@ -547,21 +555,12 @@ test_suite "singlethread" -description {
|
||||
test_suite "nomutex" -description {
|
||||
Tests run with the SQLITE_OPEN_MULTITHREADED flag passed to sqlite3_open().
|
||||
} -initialize {
|
||||
rename sqlite3 sqlite3_nomutex
|
||||
proc sqlite3 {args} {
|
||||
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
||||
lappend args -fullmutex 0 -nomutex 1
|
||||
}
|
||||
uplevel [concat sqlite3_nomutex $args]
|
||||
}
|
||||
set ::G(perm:sqlite3_args) [list -fullmutex 0 -nomutex 1]
|
||||
} -files {
|
||||
delete.test delete2.test insert.test rollback.test select1.test
|
||||
select2.test trans.test update.test vacuum.test types.test
|
||||
types2.test types3.test
|
||||
} -shutdown {
|
||||
rename sqlite3 {}
|
||||
rename sqlite3_nomutex sqlite3
|
||||
}
|
||||
}
|
||||
|
||||
# Run some tests in SQLITE_CONFIG_MULTITHREAD mode.
|
||||
#
|
||||
@@ -590,20 +589,11 @@ test_suite "multithread" -description {
|
||||
test_suite "fullmutex" -description {
|
||||
Tests run in SQLITE_OPEN_FULLMUTEX mode
|
||||
} -initialize {
|
||||
rename sqlite3 sqlite3_fullmutex
|
||||
proc sqlite3 {args} {
|
||||
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
||||
lappend args -nomutex 0 -fullmutex 1
|
||||
}
|
||||
uplevel [concat sqlite3_fullmutex $args]
|
||||
}
|
||||
set ::G(perm:sqlite3_args) [list -nomutex 0 -fullmutex 1]
|
||||
} -files {
|
||||
delete.test delete2.test insert.test rollback.test select1.test
|
||||
select2.test trans.test update.test vacuum.test types.test
|
||||
types2.test types3.test
|
||||
} -shutdown {
|
||||
rename sqlite3 {}
|
||||
rename sqlite3_fullmutex sqlite3
|
||||
}
|
||||
|
||||
# Run some tests using the "onefile" demo.
|
||||
@@ -611,19 +601,10 @@ test_suite "fullmutex" -description {
|
||||
test_suite "onefile" -description {
|
||||
Run some tests using the "test_onefile.c" demo
|
||||
} -initialize {
|
||||
rename sqlite3 sqlite3_onefile
|
||||
proc sqlite3 {args} {
|
||||
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
||||
lappend args -vfs fs
|
||||
}
|
||||
uplevel [concat sqlite3_onefile $args]
|
||||
}
|
||||
set ::G(perm:sqlite3_args) [list -vfs fs]
|
||||
} -files {
|
||||
conflict.test insert.test insert2.test insert3.test
|
||||
rollback.test select1.test select2.test select3.test
|
||||
} -shutdown {
|
||||
rename sqlite3 {}
|
||||
rename sqlite3_onefile sqlite3
|
||||
}
|
||||
|
||||
# Run some tests using UTF-16 databases.
|
||||
@@ -925,17 +906,8 @@ ifcapable threadsafe {
|
||||
test_suite "safe_append" -description {
|
||||
Run some tests on a SAFE_APPEND file-system.
|
||||
} -initialize {
|
||||
rename sqlite3 sqlite3_safeappend
|
||||
proc sqlite3 {args} {
|
||||
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
||||
lappend args -vfs devsym
|
||||
}
|
||||
uplevel [concat sqlite3_safeappend $args]
|
||||
}
|
||||
set ::G(perm:sqlite3_args) [list -vfs devsym]
|
||||
sqlite3_simulate_device -char safe_append
|
||||
} -shutdown {
|
||||
rename sqlite3 {}
|
||||
rename sqlite3_shutdown sqlite3
|
||||
} -files [
|
||||
test_set $::allquicktests shared_err.test -exclude async3.test
|
||||
]
|
||||
@@ -1082,13 +1054,33 @@ test_suite "no_optimization" -description {
|
||||
test_suite "prepare" -description {
|
||||
Run tests with the db connection using sqlite3_prepare() instead of _v2().
|
||||
} -dbconfig {
|
||||
db_use_legacy_prepare $::dbhandle 1
|
||||
$::dbhandle version -use-legacy-prepare 1
|
||||
#$::dbhandle cache size 0
|
||||
} -files [
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* \
|
||||
stmtvtab1.test index9.test
|
||||
]
|
||||
|
||||
test_suite "sorterref" -prefix "" -description {
|
||||
Run the "veryquick" test suite with SQLITE_CONFIG_SORTERREF_SIZE set
|
||||
to 0 so that sorter-references are used whenever possible.
|
||||
} -files [
|
||||
test_set $allquicktests -exclude *malloc* *ioerr* *fault* *bigfile* *_err* \
|
||||
*fts5corrupt* *fts5big* *fts5aj*
|
||||
] -initialize {
|
||||
catch {db close}
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_sorterref 0
|
||||
sqlite3_initialize
|
||||
autoinstall_test_functions
|
||||
} -shutdown {
|
||||
catch {db close}
|
||||
sqlite3_shutdown
|
||||
sqlite3_config_sorterref -1
|
||||
sqlite3_initialize
|
||||
autoinstall_test_functions
|
||||
}
|
||||
|
||||
# End of tests
|
||||
#############################################################################
|
||||
|
||||
@@ -1099,30 +1091,38 @@ test_suite "prepare" -description {
|
||||
# -description TITLE
|
||||
# -initialize SCRIPT
|
||||
# -shutdown SCRIPT
|
||||
# -presql SQL
|
||||
# -files LIST-OF-FILES
|
||||
# -prefix NAME
|
||||
# -dbconfig SCRIPT
|
||||
#
|
||||
proc run_tests {name args} {
|
||||
set options(-initialize) ""
|
||||
set options(-shutdown) ""
|
||||
set options(-prefix) ""
|
||||
set options(-dbconfig) ""
|
||||
set options(-presql) ""
|
||||
|
||||
array set options $args
|
||||
|
||||
set ::G(perm:name) $name
|
||||
set ::G(perm:prefix) $options(-prefix)
|
||||
set ::G(perm:presql) $options(-presql)
|
||||
set ::G(isquick) 1
|
||||
set ::G(perm:dbconfig) $options(-dbconfig)
|
||||
set ::G(perm:presql) $options(-presql)
|
||||
|
||||
foreach file [lsort $options(-files)] {
|
||||
uplevel $options(-initialize)
|
||||
if {[file tail $file] == $file} { set file [file join $::testdir $file] }
|
||||
slave_test_file $file
|
||||
uplevel $options(-shutdown)
|
||||
|
||||
unset -nocomplain ::G(perm:sqlite3_args)
|
||||
}
|
||||
|
||||
unset ::G(perm:name)
|
||||
unset ::G(perm:prefix)
|
||||
unset ::G(perm:presql)
|
||||
unset ::G(perm:dbconfig)
|
||||
unset ::G(perm:presql)
|
||||
}
|
||||
|
||||
proc run_test_suite {name} {
|
||||
@@ -1136,19 +1136,29 @@ proc help {} {
|
||||
puts "Usage: $::argv0 TESTSUITE ?TESTFILE?"
|
||||
puts ""
|
||||
puts "Available test-suites are:"
|
||||
|
||||
set iPos 0
|
||||
foreach k $::testsuitelist {
|
||||
if {[info exists ::testspec($k)]==0} {
|
||||
puts " ----------------------------------------"
|
||||
puts ""
|
||||
} else {
|
||||
array set o $::testspec($k)
|
||||
puts "Test suite: \"$k\""
|
||||
set d [string trim $o(-description)]
|
||||
set d [regsub {\n *} $d "\n "]
|
||||
puts " $d"
|
||||
puts ""
|
||||
if {[info exists ::testspec($k)]} {
|
||||
switch $iPos {
|
||||
0 {
|
||||
puts ""
|
||||
puts -nonewline " [format %-30s $k]"
|
||||
}
|
||||
|
||||
1 {
|
||||
puts -nonewline [format %-30s $k]
|
||||
}
|
||||
|
||||
2 {
|
||||
puts -nonewline $k
|
||||
}
|
||||
}
|
||||
|
||||
set iPos [expr (($iPos+1) % 3)]
|
||||
}
|
||||
}
|
||||
puts ""
|
||||
exit -1
|
||||
}
|
||||
|
||||
@@ -1157,11 +1167,35 @@ if {[file tail $argv0] == "permutations.test"} {
|
||||
if {[llength $argv]==0} {
|
||||
help
|
||||
} else {
|
||||
|
||||
# See if the first argument is a named test-suite.
|
||||
#
|
||||
set suite [file tail [lindex $argv 0]]
|
||||
if {[info exists ::testspec($suite)]==0} help
|
||||
if {[info exists ::testspec($suite)]} {
|
||||
set S $::testspec($suite)
|
||||
set i 1
|
||||
} else {
|
||||
set S [list]
|
||||
set i 0
|
||||
}
|
||||
|
||||
set extra ""
|
||||
if {[llength $argv]>1} { set extra [list -files [lrange $argv 1 end]] }
|
||||
eval run_tests $suite $::testspec($suite) $extra
|
||||
if {$i < [llength $argv] && [string range [lindex $argv $i] 0 0]!="-" } {
|
||||
set files [list]
|
||||
for {} {$i < [llength $argv]} {incr i} {
|
||||
set pattern [string map {% *} [lindex $argv $i]]
|
||||
if {[string range $pattern 0 0]=="-"} break
|
||||
foreach f $::alltests {
|
||||
set tail [file tail $f]
|
||||
if {[lsearch $files $f]<0 && [string match $pattern $tail]} {
|
||||
lappend files $f
|
||||
}
|
||||
}
|
||||
}
|
||||
set extra [list -files $files]
|
||||
}
|
||||
|
||||
eval run_tests $suite $S $extra
|
||||
}
|
||||
}
|
||||
main $argv
|
||||
|
Reference in New Issue
Block a user