2008-06-21 22:07:37 +04:00
|
|
|
# 2008 June 21
|
|
|
|
#
|
|
|
|
# The author disclaims copyright to this source code. In place of
|
|
|
|
# a legal notice, here is a blessing:
|
|
|
|
#
|
|
|
|
# May you do good and not evil.
|
|
|
|
# May you find forgiveness for yourself and forgive others.
|
|
|
|
# May you share freely, never taking more than you give.
|
|
|
|
#
|
|
|
|
#***********************************************************************
|
|
|
|
#
|
|
|
|
|
|
|
|
set testdir [file dirname $argv0]
|
|
|
|
source $testdir/tester.tcl
|
2010-06-11 23:04:21 +04:00
|
|
|
db close
|
2008-06-21 22:07:37 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# test_suite NAME OPTIONS
|
2008-06-21 22:07:37 +04:00
|
|
|
#
|
|
|
|
# where available options are:
|
|
|
|
#
|
2010-06-07 21:47:26 +04:00
|
|
|
# -description TITLE (default "")
|
2008-06-21 22:07:37 +04:00
|
|
|
# -initialize SCRIPT (default "")
|
|
|
|
# -shutdown SCRIPT (default "")
|
|
|
|
# -presql SQL (default "")
|
2010-06-15 10:56:37 +04:00
|
|
|
# -files LIST-OF-FILES (default $::ALLTESTS)
|
2010-06-15 22:00:06 +04:00
|
|
|
# -prefix NAME (default "$::NAME.")
|
2010-06-15 10:56:37 +04:00
|
|
|
#
|
|
|
|
proc test_suite {name args} {
|
2010-06-07 21:47:26 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
set default(-shutdown) ""
|
|
|
|
set default(-initialize) ""
|
|
|
|
set default(-presql) ""
|
2010-06-07 21:47:26 +04:00
|
|
|
set default(-description) "no description supplied (fixme)"
|
2010-06-15 22:00:06 +04:00
|
|
|
set default(-files) ""
|
|
|
|
set default(-prefix) "${name}."
|
2010-06-07 21:47:26 +04:00
|
|
|
|
|
|
|
array set options [array get default]
|
2010-06-15 10:56:37 +04:00
|
|
|
if {[llength $args]%2} {
|
|
|
|
error "uneven number of options/switches passed to test_suite"
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
foreach {k v} $args {
|
|
|
|
set o [array names options ${k}*]
|
|
|
|
if {[llength $o]>1} { error "ambiguous option: $k" }
|
|
|
|
if {[llength $o]==0} { error "unknown option: $k" }
|
|
|
|
set options([lindex $o 0]) $v
|
2008-08-25 21:23:29 +04:00
|
|
|
}
|
2008-06-21 22:07:37 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
set ::testspec($name) [array get options]
|
|
|
|
lappend ::testsuitelist $name
|
2010-06-15 21:44:47 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
}
|
2010-06-07 21:47:26 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# test_set ARGS...
|
|
|
|
#
|
|
|
|
proc test_set {args} {
|
|
|
|
set isExclude 0
|
|
|
|
foreach a $args {
|
|
|
|
if {[string match -* $a]} {
|
|
|
|
switch -- $a {
|
|
|
|
-include { set isExclude 0 }
|
|
|
|
-exclude { set isExclude 1 }
|
|
|
|
default {
|
|
|
|
error "Unknown switch: $a"
|
|
|
|
}
|
2008-08-30 17:25:10 +04:00
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
} elseif {$isExclude == 0} {
|
|
|
|
foreach f $a { set t($f) 1 }
|
2008-08-25 21:23:29 +04:00
|
|
|
} else {
|
2010-06-15 10:56:37 +04:00
|
|
|
foreach f $a { array unset t $f }
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
return [array names t]
|
|
|
|
}
|
2010-06-07 21:47:26 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Set up the following global list variables containing the names of
|
|
|
|
# various test scripts:
|
|
|
|
#
|
|
|
|
# $alltests
|
2010-06-15 22:00:06 +04:00
|
|
|
# $allquicktests
|
2010-06-15 10:56:37 +04:00
|
|
|
#
|
|
|
|
set alltests [list]
|
|
|
|
foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
|
|
|
|
if {$::tcl_platform(platform)!="unix"} {
|
|
|
|
set alltests [test_set $alltests -exclude crash.test crash2.test]
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
set alltests [test_set $alltests -exclude {
|
|
|
|
all.test async.test quick.test veryquick.test
|
|
|
|
memleak.test permutations.test soak.test fts3.test
|
|
|
|
mallocAll.test
|
|
|
|
}]
|
2008-06-21 22:07:37 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
set allquicktests [test_set $alltests -exclude {
|
|
|
|
async2.test async3.test backup_ioerr.test corrupt.test
|
|
|
|
corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test
|
|
|
|
crash6.test crash7.test delete3.test e_fts3.test fts3rnd.test
|
|
|
|
fkey_malloc.test fuzz.test fuzz3.test fuzz_malloc.test in2.test loadext.test
|
2010-06-26 19:42:33 +04:00
|
|
|
misc7.test mutex2.test notify2.test onefile.test pagerfault2.test
|
2010-06-15 10:56:37 +04:00
|
|
|
savepoint4.test savepoint6.test select9.test
|
|
|
|
speed1.test speed1p.test speed2.test speed3.test speed4.test
|
|
|
|
speed4p.test sqllimits1.test tkt2686.test thread001.test thread002.test
|
|
|
|
thread003.test thread004.test thread005.test trans2.test vacuum3.test
|
|
|
|
incrvacuum_ioerr.test autovacuum_crash.test btree8.test shared_err.test
|
|
|
|
vtab_err.test walslow.test walcrash.test
|
2010-06-26 19:42:33 +04:00
|
|
|
walthread.test
|
2010-06-15 10:56:37 +04:00
|
|
|
}]
|
2008-08-30 17:25:10 +04:00
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
#############################################################################
|
|
|
|
# Start of tests
|
2010-06-15 10:56:37 +04:00
|
|
|
#
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Define the generic test suites:
|
|
|
|
#
|
|
|
|
# veryquick
|
|
|
|
# quick
|
|
|
|
# full
|
|
|
|
# veryquick_plus_notify2
|
|
|
|
#
|
2010-06-15 21:44:47 +04:00
|
|
|
lappend ::testsuitelist xxx
|
2010-06-15 10:56:37 +04:00
|
|
|
|
2010-06-15 22:00:06 +04:00
|
|
|
test_suite "veryquick" -prefix "" -description {
|
2010-06-15 10:56:37 +04:00
|
|
|
"Very" quick test suite. Runs in less than 5 minutes on a workstation.
|
|
|
|
This test suite is the same as the "quick" tests, except that some files
|
|
|
|
that test malloc and IO errors are omitted.
|
|
|
|
} -files [
|
2010-06-22 17:46:43 +04:00
|
|
|
test_set $allquicktests -exclude *malloc* *ioerr* *fault*
|
2010-06-15 10:56:37 +04:00
|
|
|
]
|
|
|
|
|
2010-06-15 22:00:06 +04:00
|
|
|
test_suite "quick" -prefix "" -description {
|
2010-06-15 10:56:37 +04:00
|
|
|
Quick test suite. Runs in around 10 minutes on a workstation.
|
|
|
|
} -files [
|
|
|
|
test_set $allquicktests
|
|
|
|
]
|
|
|
|
|
2010-06-15 22:00:06 +04:00
|
|
|
test_suite "veryquick_plus_notify2" -prefix "" -description {
|
2010-06-15 10:56:37 +04:00
|
|
|
Very quick test suite + file notify2.test. This is used by one of the
|
|
|
|
sqlite.org release test configurations.
|
|
|
|
} -files [
|
|
|
|
test_set $allquicktests notify2.test -exclude *malloc* *ioerr* *fault*
|
|
|
|
]
|
|
|
|
|
2010-06-15 22:00:06 +04:00
|
|
|
test_suite "full" -prefix "" -description {
|
2010-06-15 10:56:37 +04:00
|
|
|
Full test suite. Takes a long time.
|
|
|
|
} -files [
|
|
|
|
test_set $alltests
|
|
|
|
] -initialize {
|
|
|
|
unset -nocomplain ::G(isquick)
|
|
|
|
}
|
|
|
|
|
2010-06-15 21:44:47 +04:00
|
|
|
lappend ::testsuitelist xxx
|
2010-06-15 10:56:37 +04:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Define the coverage related test suites:
|
|
|
|
#
|
|
|
|
# coverage-wal
|
|
|
|
#
|
|
|
|
test_suite "coverage-wal" -description {
|
|
|
|
Coverage tests for file wal.c.
|
|
|
|
} -files {
|
2010-07-03 14:00:00 +04:00
|
|
|
wal.test wal2.test wal3.test walmode.test
|
|
|
|
walbak.test walhook.test walcrash2.test walcksum.test
|
2010-06-15 10:56:37 +04:00
|
|
|
walfault.test
|
|
|
|
}
|
|
|
|
|
2010-06-15 21:44:47 +04:00
|
|
|
test_suite "coverage-pager" -description {
|
|
|
|
Coverage tests for file pager.c.
|
|
|
|
} -files {
|
2010-07-03 14:00:00 +04:00
|
|
|
pager1.test pager2.test pagerfault.test pagerfault2.test
|
|
|
|
walfault.test walbak.test journal2.test tkt-9d68c883.test
|
2010-06-15 21:44:47 +04:00
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
|
|
|
|
|
2010-06-15 21:44:47 +04:00
|
|
|
lappend ::testsuitelist xxx
|
2010-06-15 10:56:37 +04:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Define the permutation test suites:
|
|
|
|
#
|
2008-06-21 22:07:37 +04:00
|
|
|
|
|
|
|
# Run some tests using pre-allocated page and scratch blocks.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "memsubsys1" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Tests using pre-allocated page and scratch blocks
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [
|
|
|
|
test_set $::allquicktests -exclude ioerr5.test malloc5.test
|
|
|
|
] -initialize {
|
2008-07-30 17:15:46 +04:00
|
|
|
catch {db close}
|
2008-06-21 22:07:37 +04:00
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_pagecache 4096 24
|
|
|
|
sqlite3_config_scratch 25000 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_pagecache 0 0
|
|
|
|
sqlite3_config_scratch 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# Run some tests using pre-allocated page and scratch blocks. This time
|
|
|
|
# the allocations are too small to use in most cases.
|
|
|
|
#
|
2008-08-29 16:00:20 +04:00
|
|
|
# Both ioerr5.test and malloc5.test are excluded because they test the
|
|
|
|
# sqlite3_soft_heap_limit() and sqlite3_release_memory() functionality.
|
|
|
|
# This functionality is disabled if a pre-allocated page block is provided.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "memsubsys2" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Tests using small pre-allocated page and scratch blocks
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [
|
|
|
|
test_set $::allquicktests -exclude ioerr5.test malloc5.test
|
|
|
|
] -initialize {
|
2008-07-30 17:15:46 +04:00
|
|
|
catch {db close}
|
2008-06-21 22:07:37 +04:00
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_pagecache 512 5
|
|
|
|
sqlite3_config_scratch 1000 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_pagecache 0 0
|
|
|
|
sqlite3_config_scratch 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
|
|
|
|
2008-08-01 19:06:30 +04:00
|
|
|
# Run all tests with the lookaside allocator disabled.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "nolookaside" -description {
|
2008-08-01 19:06:30 +04:00
|
|
|
OOM tests with lookaside disabled
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_lookaside 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-08-01 19:06:30 +04:00
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_lookaside 100 500
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files $::allquicktests
|
2008-08-01 19:06:30 +04:00
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
# Run some tests in SQLITE_CONFIG_SINGLETHREAD mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "singlethread" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Tests run in SQLITE_CONFIG_SINGLETHREAD mode
|
|
|
|
} -initialize {
|
2009-01-06 17:50:11 +03:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
catch {sqlite3_config singlethread}
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
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 {
|
2009-01-06 17:50:11 +03:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
catch {sqlite3_config serialized}
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "nomutex" -description {
|
2008-09-03 04:43:15 +04:00
|
|
|
Tests run with the SQLITE_OPEN_MULTITHREADED flag passed to sqlite3_open().
|
2008-07-10 21:52:49 +04:00
|
|
|
} -initialize {
|
|
|
|
rename sqlite3 sqlite3_nomutex
|
|
|
|
proc sqlite3 {args} {
|
|
|
|
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
2008-09-03 05:08:00 +04:00
|
|
|
lappend args -fullmutex 0 -nomutex 1
|
2008-07-10 21:52:49 +04:00
|
|
|
}
|
|
|
|
uplevel [concat sqlite3_nomutex $args]
|
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-07-10 21:52:49 +04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
# Run some tests in SQLITE_CONFIG_MULTITHREAD mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "multithread" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Tests run in SQLITE_CONFIG_MULTITHREAD mode
|
|
|
|
} -initialize {
|
2009-01-06 17:50:11 +03:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
catch {sqlite3_config multithread}
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
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 {
|
2009-01-06 17:50:11 +03:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
catch {sqlite3_config serialized}
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2008-06-21 22:07:37 +04:00
|
|
|
}
|
|
|
|
|
2008-09-03 04:43:15 +04:00
|
|
|
# Run some tests in SQLITE_OPEN_FULLMUTEX mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "fullmutex" -description {
|
2008-09-03 04:43:15 +04:00
|
|
|
Tests run in SQLITE_OPEN_FULLMUTEX mode
|
|
|
|
} -initialize {
|
|
|
|
rename sqlite3 sqlite3_fullmutex
|
|
|
|
proc sqlite3 {args} {
|
|
|
|
if {[string range [lindex $args 0] 0 0] ne "-"} {
|
2008-09-03 05:08:00 +04:00
|
|
|
lappend args -nomutex 0 -fullmutex 1
|
2008-09-03 04:43:15 +04:00
|
|
|
}
|
|
|
|
uplevel [concat sqlite3_fullmutex $args]
|
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-09-03 04:43:15 +04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
# Run some tests using the "onefile" demo.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "onefile" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
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]
|
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
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.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "utf16" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run tests using UTF-16 databases
|
2008-06-21 23:10:27 +04:00
|
|
|
} -presql {
|
2008-06-21 22:07:37 +04:00
|
|
|
pragma encoding = 'UTF-16'
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
alter.test alter3.test
|
|
|
|
auth.test bind.test blob.test capi2.test capi3.test collate1.test
|
|
|
|
collate2.test collate3.test collate4.test collate5.test collate6.test
|
|
|
|
conflict.test date.test delete.test expr.test fkey1.test func.test
|
|
|
|
hook.test index.test insert2.test insert.test interrupt.test in.test
|
|
|
|
intpkey.test ioerr.test join2.test join.test lastinsert.test
|
|
|
|
laststmtchanges.test limit.test lock2.test lock.test main.test
|
|
|
|
memdb.test minmax.test misc1.test misc2.test misc3.test notnull.test
|
|
|
|
null.test progress.test quote.test rowid.test select1.test select2.test
|
|
|
|
select3.test select4.test select5.test select6.test sort.test
|
|
|
|
subselect.test tableapi.test table.test temptable.test
|
|
|
|
trace.test trigger1.test trigger2.test trigger3.test
|
|
|
|
trigger4.test types2.test types.test unique.test update.test
|
|
|
|
vacuum.test view.test where.test
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run some tests in exclusive locking mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "exclusive" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run tests in exclusive locking mode.
|
|
|
|
} -presql {
|
|
|
|
pragma locking_mode = 'exclusive'
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
rollback.test select1.test select2.test
|
|
|
|
malloc.test ioerr.test
|
|
|
|
}
|
|
|
|
|
2008-09-27 01:08:08 +04:00
|
|
|
# Run some tests in exclusive locking mode with truncated journals.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "exclusive-truncate" -description {
|
2008-09-27 01:08:08 +04:00
|
|
|
Run tests in exclusive locking mode and truncate journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma locking_mode = 'exclusive';
|
|
|
|
pragma journal_mode = TRUNCATE;
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-09-27 01:08:08 +04:00
|
|
|
delete.test delete2.test insert.test rollback.test select1.test
|
|
|
|
select2.test update.test malloc.test ioerr.test
|
|
|
|
}
|
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
# Run some tests in persistent journal mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "persistent_journal" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run tests in persistent-journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = persist
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
delete.test delete2.test insert.test rollback.test select1.test
|
|
|
|
select2.test trans.test update.test vacuum.test
|
|
|
|
}
|
|
|
|
|
2008-09-27 01:08:08 +04:00
|
|
|
# Run some tests in truncating journal mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "truncate_journal" -description {
|
2008-09-27 01:08:08 +04:00
|
|
|
Run tests in persistent-journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = truncate
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-09-27 01:08:08 +04:00
|
|
|
delete.test delete2.test insert.test rollback.test select1.test
|
|
|
|
select2.test trans.test update.test vacuum.test
|
|
|
|
malloc.test ioerr.test
|
|
|
|
}
|
|
|
|
|
2008-06-21 22:07:37 +04:00
|
|
|
# Run some error tests in persistent journal mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "persistent_journal_error" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run malloc.test and ioerr.test in persistent-journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = persist
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
malloc.test ioerr.test
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run some tests in no journal mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "no_journal" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run tests in no-journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = persist
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
delete.test delete2.test insert.test rollback.test select1.test
|
|
|
|
select2.test trans.test update.test vacuum.test
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run some error tests in no journal mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "no_journal_error" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run malloc.test and ioerr.test in no-journal mode.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = persist
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-06-21 22:07:37 +04:00
|
|
|
malloc.test ioerr.test
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run some crash-tests in autovacuum mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "autovacuum_crash" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run crash.test in autovacuum mode.
|
|
|
|
} -presql {
|
|
|
|
pragma auto_vacuum = 1
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files crash.test
|
2008-06-21 22:07:37 +04:00
|
|
|
|
|
|
|
# Run some ioerr-tests in autovacuum mode.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "autovacuum_ioerr" -description {
|
2008-06-21 22:07:37 +04:00
|
|
|
Run ioerr.test in autovacuum mode.
|
|
|
|
} -presql {
|
|
|
|
pragma auto_vacuum = 1
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ioerr.test
|
2008-06-21 22:07:37 +04:00
|
|
|
|
2008-10-17 22:51:52 +04:00
|
|
|
# Run tests with an in-memory journal.
|
|
|
|
#
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "inmemory_journal" -description {
|
2008-10-17 22:51:52 +04:00
|
|
|
Run tests with an in-memory journal file.
|
|
|
|
} -presql {
|
|
|
|
pragma journal_mode = 'memory'
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [test_set $::allquicktests -exclude {
|
2008-10-17 22:51:52 +04:00
|
|
|
# Exclude all tests that simulate IO errors.
|
|
|
|
autovacuum_ioerr2.test incrvacuum_ioerr.test ioerr.test
|
|
|
|
ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test
|
2009-04-02 03:09:43 +04:00
|
|
|
vacuum3.test incrblob_err.test diskfull.test backup_ioerr.test
|
2010-04-13 00:54:13 +04:00
|
|
|
e_fts3.test
|
2008-10-17 22:51:52 +04:00
|
|
|
|
|
|
|
# Exclude test scripts that use tcl IO to access journal files or count
|
|
|
|
# the number of fsync() calls.
|
|
|
|
pager.test exclusive.test jrnlmode.test sync.test misc1.test
|
2009-04-10 22:32:29 +04:00
|
|
|
journal1.test conflict.test crash8.test tkt3457.test io.test
|
2010-03-08 13:32:38 +03:00
|
|
|
|
|
|
|
# Exclude stmt.test, which expects sub-journals to use temporary files.
|
|
|
|
stmt.test
|
2010-05-25 00:24:38 +04:00
|
|
|
|
|
|
|
# WAL mode is different.
|
2010-06-15 10:56:37 +04:00
|
|
|
wal*
|
|
|
|
}]
|
2008-10-17 22:51:52 +04:00
|
|
|
|
2008-06-25 18:57:53 +04:00
|
|
|
ifcapable mem3 {
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "memsys3" -description {
|
2008-06-25 18:57:53 +04:00
|
|
|
Run tests using the allocator in mem3.c.
|
2010-06-15 10:56:37 +04:00
|
|
|
} [test_set $::allquicktests -exclude {
|
2008-07-10 22:13:42 +04:00
|
|
|
autovacuum.test delete3.test manydb.test
|
|
|
|
bigrow.test incrblob2.test memdb.test
|
|
|
|
bitvec.test index2.test memsubsys1.test
|
|
|
|
capi3c.test ioerr.test memsubsys2.test
|
|
|
|
capi3.test join3.test pagesize.test
|
2009-07-01 22:09:01 +04:00
|
|
|
collate5.test limit.test backup_ioerr.test
|
|
|
|
backup_malloc.test
|
2010-06-15 10:56:37 +04:00
|
|
|
}] -initialize {
|
2008-06-25 18:57:53 +04:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_reset_auto_extension
|
|
|
|
sqlite3_shutdown
|
2008-07-16 16:25:32 +04:00
|
|
|
sqlite3_config_heap 25000000 0
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 0 0
|
2009-07-01 22:09:01 +04:00
|
|
|
ifcapable mem5 {
|
|
|
|
# If both memsys3 and memsys5 are enabled in the build, the call to
|
|
|
|
# [sqlite3_config_heap] will initialize the system to use memsys5.
|
|
|
|
# The following overrides this preference and installs the memsys3
|
|
|
|
# allocator.
|
|
|
|
sqlite3_install_memsys3
|
|
|
|
}
|
2008-06-25 18:57:53 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
2008-06-27 18:05:24 +04:00
|
|
|
sqlite3_config_heap 0 0
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 100 500
|
2008-06-25 18:57:53 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-25 18:57:53 +04:00
|
|
|
}
|
2008-06-24 23:02:55 +04:00
|
|
|
}
|
|
|
|
|
2008-06-25 18:57:53 +04:00
|
|
|
ifcapable mem5 {
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "memsys5" -description {
|
2008-06-25 18:57:53 +04:00
|
|
|
Run tests using the allocator in mem5.c.
|
2010-06-15 10:56:37 +04:00
|
|
|
} [test_set $::allquicktests -exclude {
|
2008-07-10 22:13:42 +04:00
|
|
|
autovacuum.test delete3.test manydb.test
|
|
|
|
bigrow.test incrblob2.test memdb.test
|
|
|
|
bitvec.test index2.test memsubsys1.test
|
|
|
|
capi3c.test ioerr.test memsubsys2.test
|
|
|
|
capi3.test join3.test pagesize.test
|
2008-11-13 19:21:50 +03:00
|
|
|
collate5.test limit.test zeroblob.test
|
2010-06-15 10:56:37 +04:00
|
|
|
}] -initialize {
|
2008-06-25 18:57:53 +04:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
2008-07-16 16:25:32 +04:00
|
|
|
sqlite3_config_heap 25000000 64
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 0 0
|
2008-06-27 17:27:03 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
2008-06-27 18:05:24 +04:00
|
|
|
sqlite3_config_heap 0 0
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 100 500
|
2008-06-27 17:27:03 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-27 17:27:03 +04:00
|
|
|
}
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "memsys5-2" -description {
|
2008-06-27 17:27:03 +04:00
|
|
|
Run tests using the allocator in mem5.c in a different configuration.
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2008-07-10 22:13:42 +04:00
|
|
|
select1.test
|
2008-06-27 17:27:03 +04:00
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
2008-07-16 16:25:32 +04:00
|
|
|
sqlite3_config_heap 40000000 16
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 0 0
|
2008-06-25 18:57:53 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
2008-06-27 18:05:24 +04:00
|
|
|
sqlite3_config_heap 0 0
|
2008-08-01 19:06:30 +04:00
|
|
|
sqlite3_config_lookaside 100 500
|
2008-06-25 18:57:53 +04:00
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2008-06-25 18:57:53 +04:00
|
|
|
}
|
2008-06-25 18:26:07 +04:00
|
|
|
}
|
|
|
|
|
2008-07-10 22:13:42 +04:00
|
|
|
ifcapable threadsafe {
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "no_mutex_try" -description {
|
2008-07-10 22:13:42 +04:00
|
|
|
The sqlite3_mutex_try() interface always fails
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [
|
|
|
|
test_set $::allquicktests -exclude mutex1.test mutex2.test
|
|
|
|
] -initialize {
|
2008-07-10 22:13:42 +04:00
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
install_mutex_counters 1
|
|
|
|
set ::disable_mutex_try 1
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2008-07-10 22:13:42 +04:00
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
install_mutex_counters 0
|
2009-04-09 05:23:49 +04:00
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
2008-07-10 22:13:42 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-23 19:55:52 +04:00
|
|
|
# run_tests "crash_safe_append" -description {
|
|
|
|
# Run crash.test with persistent journals on a SAFE_APPEND file-system.
|
|
|
|
# } -initialize {
|
|
|
|
# rename crashsql sa_crashsql
|
|
|
|
# proc crashsql {args} {
|
|
|
|
# set options [lrange $args 0 [expr {[llength $args]-2}]]
|
|
|
|
# lappend options -char safe_append
|
|
|
|
# set sql [lindex $args end]
|
|
|
|
# lappend options "
|
|
|
|
# PRAGMA journal_mode=persistent;
|
|
|
|
# $sql
|
|
|
|
# "
|
|
|
|
# set fd [open test.db-journal w]
|
|
|
|
# puts $fd [string repeat 1234567890 100000]
|
|
|
|
# close $fd
|
|
|
|
# eval sa_crashsql $options
|
|
|
|
# }
|
|
|
|
# } -shutdown {
|
|
|
|
# rename crashsql {}
|
|
|
|
# rename sa_crashsql crashsql
|
2010-06-15 10:56:37 +04:00
|
|
|
# } -files crash.test
|
2008-06-23 19:55:52 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "safe_append" -description {
|
2008-09-12 14:22:40 +04:00
|
|
|
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]
|
|
|
|
}
|
|
|
|
sqlite3_simulate_device -char safe_append
|
|
|
|
} -shutdown {
|
|
|
|
rename sqlite3 {}
|
|
|
|
rename sqlite3_shutdown sqlite3
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [
|
|
|
|
test_set $::allquicktests shared_err.test -exclude async3.test
|
|
|
|
]
|
2008-09-12 14:22:40 +04:00
|
|
|
|
2008-11-19 04:20:26 +03:00
|
|
|
# The set of tests to run on the alternative-pcache
|
|
|
|
set perm-alt-pcache-testset {
|
|
|
|
async.test
|
|
|
|
attach.test
|
|
|
|
delete.test delete2.test
|
|
|
|
index.test
|
|
|
|
insert.test insert2.test
|
|
|
|
join.test join2.test
|
|
|
|
rollback.test
|
|
|
|
select1.test select2.test
|
|
|
|
trans.test
|
|
|
|
update.test
|
|
|
|
}
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "pcache0" -description {
|
2008-11-19 04:20:26 +03:00
|
|
|
Alternative pcache implementation without random discard
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 1 0 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 0 0 0
|
|
|
|
sqlite3_config_lookaside 100 500
|
|
|
|
install_malloc_faultsim 1
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ${perm-alt-pcache-testset}
|
2008-11-19 04:20:26 +03:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "pcache10" -description {
|
2008-11-19 04:20:26 +03:00
|
|
|
Alternative pcache implementation without 10% random discard
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 1 50 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 0 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ${perm-alt-pcache-testset}
|
2008-11-19 04:20:26 +03:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "pcache50" -description {
|
2008-11-19 04:20:26 +03:00
|
|
|
Alternative pcache implementation without 50% random discard
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 1 50 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 0 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ${perm-alt-pcache-testset}
|
2008-11-19 04:20:26 +03:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "pcache90" -description {
|
2008-11-19 04:20:26 +03:00
|
|
|
Alternative pcache implementation without 90% random discard
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 1 50 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 0 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ${perm-alt-pcache-testset}
|
2008-11-19 04:20:26 +03:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "pcache100" -description {
|
2008-11-19 04:20:26 +03:00
|
|
|
Alternative pcache implementation that always discards when unpinning
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 1 100 1
|
|
|
|
sqlite3_initialize
|
|
|
|
autoinstall_test_functions
|
|
|
|
} -shutdown {
|
|
|
|
catch {db close}
|
|
|
|
sqlite3_shutdown
|
|
|
|
sqlite3_config_alt_pcache 0 0 0
|
|
|
|
sqlite3_initialize
|
2009-04-09 05:23:49 +04:00
|
|
|
autoinstall_test_functions
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files ${perm-alt-pcache-testset}
|
2008-06-23 19:55:52 +04:00
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "journaltest" -description {
|
2008-12-22 13:58:46 +03:00
|
|
|
Check that pages are synced before being written (test_journal.c).
|
|
|
|
} -initialize {
|
|
|
|
catch {db close}
|
|
|
|
register_jt_vfs -default ""
|
|
|
|
} -shutdown {
|
|
|
|
unregister_jt_vfs
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files [test_set $::allquicktests -exclude {
|
|
|
|
wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test
|
|
|
|
async4.test bigfile.test
|
2010-05-06 23:55:57 +04:00
|
|
|
}]
|
2008-12-22 13:58:46 +03:00
|
|
|
|
2010-04-07 11:57:38 +04:00
|
|
|
if {[info commands register_demovfs] != ""} {
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "demovfs" -description {
|
2010-06-07 21:47:26 +04:00
|
|
|
Check that the demovfs (code in test_demovfs.c) more or less works.
|
2010-04-07 11:57:38 +04:00
|
|
|
} -initialize {
|
|
|
|
register_demovfs
|
|
|
|
} -shutdown {
|
|
|
|
unregister_demovfs
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2010-04-07 11:57:38 +04:00
|
|
|
insert.test insert2.test insert3.test rollback.test
|
|
|
|
select1.test select2.test select3.test
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
test_suite "wal" -description {
|
2010-04-26 16:39:03 +04:00
|
|
|
Run tests with journal_mode=WAL
|
2010-04-27 09:42:32 +04:00
|
|
|
} -initialize {
|
2010-06-07 21:47:26 +04:00
|
|
|
set ::G(savepoint6_iterations) 100
|
2010-04-27 09:42:32 +04:00
|
|
|
} -shutdown {
|
2010-06-07 21:47:26 +04:00
|
|
|
unset -nocomplain ::G(savepoint6_iterations)
|
2010-06-15 10:56:37 +04:00
|
|
|
} -files {
|
2010-04-27 10:49:34 +04:00
|
|
|
savepoint.test savepoint2.test savepoint6.test
|
|
|
|
trans.test avtrans.test
|
2010-04-26 16:39:03 +04:00
|
|
|
}
|
2008-06-21 22:07:37 +04:00
|
|
|
# End of tests
|
|
|
|
#############################################################################
|
|
|
|
|
2010-06-15 10:56:37 +04:00
|
|
|
# run_tests NAME OPTIONS
|
|
|
|
#
|
|
|
|
# where available options are:
|
|
|
|
#
|
2010-06-15 22:00:06 +04:00
|
|
|
# -description TITLE
|
|
|
|
# -initialize SCRIPT
|
|
|
|
# -shutdown SCRIPT
|
|
|
|
# -presql SQL
|
|
|
|
# -files LIST-OF-FILES
|
|
|
|
# -prefix NAME
|
2010-06-15 10:56:37 +04:00
|
|
|
#
|
|
|
|
proc run_tests {name args} {
|
|
|
|
array set options $args
|
|
|
|
|
2010-07-03 17:59:01 +04:00
|
|
|
set ::G(perm:name) $name
|
|
|
|
set ::G(perm:prefix) $options(-prefix)
|
2010-06-15 10:56:37 +04:00
|
|
|
set ::G(perm:presql) $options(-presql)
|
|
|
|
set ::G(isquick) 1
|
|
|
|
|
|
|
|
uplevel $options(-initialize)
|
|
|
|
|
|
|
|
foreach file [lsort $options(-files)] {
|
|
|
|
slave_test_file $::testdir/$file
|
|
|
|
}
|
|
|
|
|
|
|
|
uplevel $options(-shutdown)
|
|
|
|
|
|
|
|
unset ::G(perm:name)
|
2010-07-03 17:59:01 +04:00
|
|
|
unset ::G(perm:prefix)
|
2010-06-15 10:56:37 +04:00
|
|
|
unset ::G(perm:presql)
|
|
|
|
}
|
|
|
|
|
|
|
|
proc run_test_suite {name} {
|
|
|
|
if {[info exists ::testspec($name)]==0} {
|
|
|
|
error "No such test suite: $name"
|
|
|
|
}
|
|
|
|
uplevel run_tests $name $::testspec($name)
|
|
|
|
}
|
|
|
|
|
|
|
|
proc help {} {
|
2010-06-15 21:44:47 +04:00
|
|
|
puts "Usage: $::argv0 TESTSUITE ?TESTFILE?"
|
|
|
|
puts ""
|
|
|
|
puts "Available test-suites are:"
|
2010-06-15 10:56:37 +04:00
|
|
|
foreach k $::testsuitelist {
|
2010-06-15 21:44:47 +04:00
|
|
|
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 ""
|
|
|
|
}
|
2010-06-15 10:56:37 +04:00
|
|
|
}
|
|
|
|
exit -1
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[info script] == $argv0} {
|
|
|
|
proc main {argv} {
|
|
|
|
if {[llength $argv]==0} {
|
|
|
|
help
|
|
|
|
} else {
|
|
|
|
set suite [lindex $argv 0]
|
|
|
|
if {[info exists ::testspec($suite)]==0} help
|
|
|
|
set extra ""
|
|
|
|
if {[llength $argv]>1} { set extra [list -files [lrange $argv 1 end]] }
|
|
|
|
eval run_tests $suite $::testspec($suite) $extra
|
|
|
|
}
|
|
|
|
}
|
|
|
|
main $argv
|
|
|
|
finish_test
|
|
|
|
}
|
2008-06-21 22:07:37 +04:00
|
|
|
|