Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: third_party/sqlite/src/test/permutations.test

Issue 5626002: Update sqlite to 3.7.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/third_party/sqlite/src
Patch Set: Remove misc change. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/src/test/pcache.test ('k') | third_party/sqlite/src/test/pragma.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2008 June 21 1 # 2008 June 21
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #*********************************************************************** 10 #***********************************************************************
11 # 11 #
12 # $Id: permutations.test,v 1.51 2009/07/01 18:09:02 danielk1977 Exp $
13 12
14 set testdir [file dirname $argv0] 13 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl 14 source $testdir/tester.tcl
16 15 db close
17 # Argument processing. 16
18 # 17 #-------------------------------------------------------------------------
19 #puts "PERM-DEBUG: argv=$argv" 18 # test_suite NAME OPTIONS
20 namespace eval ::perm {
21 variable testmode [lindex $::argv 0]
22 variable testfile [lindex $::argv 1]
23 }
24 set argv [lrange $argv 2 end]
25 #puts "PERM-DEBUG: testmode=$::perm::testmode tstfile=$::perm::testfile"
26
27 set ::permutations_presql ""
28 set ::permutations_test_prefix ""
29
30 if {$::perm::testmode eq "veryquick"} {
31 set ::perm::testmode [list persistent_journal no_journal]
32 set ISQUICK 1
33 }
34 if {$::perm::testmode eq "quick"} {
35 set ::perm::testmode [list persistent_journal no_journal autovacuum_ioerr]
36 set ISQUICK 1
37 }
38 if {$::perm::testmode eq "all" || $::perm::testmode eq ""} {
39 set ::perm::testmode {
40 memsubsys1 memsubsys2 singlethread multithread onefile utf16 exclusive
41 persistent_journal persistent_journal_error no_journal no_journal_error
42 autovacuum_ioerr no_mutex_try fullmutex journaltest inmemory_journal
43 pcache0 pcache10 pcache50 pcache90 pcache100
44 }
45 }
46 if {$::perm::testmode eq "targets"} {
47 puts ""
48 puts -nonewline "veryquick "
49 puts "Same as persistent_journal and no_journal"
50 puts -nonewline "quick "
51 puts "Same as persistent_journal, no_journal and autovacuum_ioerr"
52 puts -nonewline "all "
53 puts "Everything except autovacuum_crash"
54 }
55 #puts "PERM-DEBUG: testmode=$::perm::testmode"
56
57 set EXCLUDE {
58 all.test in2.test onefile.test
59 async2.test incrvacuum_ioerr.test permutations.test
60 async.test jrnlmode2.test quick.test
61 autovacuum_crash.test jrnlmode3.test shared_err.test
62 autovacuum_ioerr.test jrnlmode4.test soak.test
63 btree8.test loadext.test speed1p.test
64 corrupt.test malloc2.test speed1.test
65 crash2.test malloc3.test speed2.test
66 crash3.test malloc4.test speed3.test
67 crash4.test mallocAll.test speed4p.test
68 crash6.test malloc.test speed4.test
69 crash7.test memleak.test sqllimits1.test
70 crash.test memsubsys1.test thread001.test
71 exclusive3.test memsubsys2.test thread002.test
72 fts3.test misc7.test utf16.test
73 fuzz_malloc.test misuse.test veryquick.test
74 fuzz.test mutex2.test vtab_err.test
75 lookaside.test fuzz3.test savepoint4.test
76 savepoint6.test
77 }
78 set ALLTESTS [list]
79 foreach filename [glob $testdir/*.test] {
80 set filename [file tail $filename]
81 if {[lsearch $EXCLUDE $filename] < 0} { lappend ALLTESTS $filename }
82 }
83 set ALLTESTS [lsort $ALLTESTS]
84
85 rename finish_test really_finish_test2
86 proc finish_test {} {}
87
88 rename do_test really_do_test
89
90 proc do_test {name args} {
91 eval really_do_test [list "perm-$::permutations_test_prefix.$name"] $args
92 }
93
94 # Overload the [sqlite3] command
95 rename sqlite3 really_sqlite3
96 proc sqlite3 {args} {
97 set r [eval really_sqlite3 $args]
98 if { [llength $args] == 2 && $::permutations_presql ne "" } {
99 [lindex $args 0] eval $::permutations_presql
100 }
101 set r
102 }
103
104 # run_tests OPTIONS
105 # 19 #
106 # where available options are: 20 # where available options are:
107 # 21 #
22 # -description TITLE (default "")
108 # -initialize SCRIPT (default "") 23 # -initialize SCRIPT (default "")
109 # -shutdown SCRIPT (default "") 24 # -shutdown SCRIPT (default "")
110 # -include LIST-OF-FILES (default $::ALLTESTS)
111 # -exclude LIST-OF-FILES (default "")
112 # -presql SQL (default "") 25 # -presql SQL (default "")
113 # -description TITLE (default "") 26 # -files LIST-OF-FILES (default $::ALLTESTS)
114 # 27 # -prefix NAME (default "$::NAME.")
115 proc run_tests {name args} { 28 #
116 set ::permutations_test_prefix $name 29 proc test_suite {name args} {
117 set options(-shutdown) "" 30
118 set options(-initialize) "" 31 set default(-shutdown) ""
119 set options(-exclude) "" 32 set default(-initialize) ""
120 set options(-include) $::ALLTESTS 33 set default(-presql) ""
121 set options(-presql) "" 34 set default(-description) "no description supplied (fixme)"
122 set options(-description) "no description supplied (fixme)" 35 set default(-files) ""
123 array set options $args 36 set default(-prefix) "${name}."
124 #puts "PERM-DEBUG: name=$name testfile=$::perm::testfile" 37
125 #puts "PERM-DEBUG: [array get options]" 38 array set options [array get default]
126 39 if {[llength $args]%2} {
127 if {$::perm::testmode eq "targets"} { 40 error "uneven number of options/switches passed to test_suite"
128 puts [format "% -20s %s" $name [string trim $options(-description)]]
129 return
130 } 41 }
131 if {$::perm::testmode ne "" && [lsearch $::perm::testmode $name]<0} { 42 foreach {k v} $args {
132 puts "skipping permutation test $name..." 43 set o [array names options ${k}*]
133 return 44 if {[llength $o]>1} { error "ambiguous option: $k" }
45 if {[llength $o]==0} { error "unknown option: $k" }
46 set options([lindex $o 0]) $v
134 } 47 }
135 48
136 uplevel $options(-initialize) 49 set ::testspec($name) [array get options]
137 set ::permutations_presql $options(-presql) 50 lappend ::testsuitelist $name
138 51
139 foreach file [lsort $options(-include)] { 52 }
140 if {[lsearch $options(-exclude) $file] < 0 && 53
141 ( $::perm::testfile eq "" || 54 #-------------------------------------------------------------------------
142 $::perm::testfile eq $file || 55 # test_set ARGS...
143 "$::perm::testfile.test" eq $file ) 56 #
144 } { 57 proc test_set {args} {
145 set ::perm::shared_cache_setting [shared_cache_setting] 58 set isExclude 0
146 uplevel source $::testdir/$file 59 foreach a $args {
147 if {$::perm::shared_cache_setting ne [shared_cache_setting]} { 60 if {[string match -* $a]} {
148 error "File $::testdir/$file changed the shared cache setting from $::pe rm::shared_cache_setting to [shared_cache_setting]" 61 switch -- $a {
62 -include { set isExclude 0 }
63 -exclude { set isExclude 1 }
64 default {
65 error "Unknown switch: $a"
66 }
149 } 67 }
68 } elseif {$isExclude == 0} {
69 foreach f $a { set t($f) 1 }
150 } else { 70 } else {
151 # puts "skipping file $file" 71 foreach f $a { array unset t $f }
72 foreach f $a { array unset t */$f }
152 } 73 }
153 } 74 }
154 75
155 uplevel $options(-shutdown) 76 return [array names t]
156 set ::permutations_test_prefix "" 77 }
157 } 78
158 79 #-------------------------------------------------------------------------
159 proc shared_cache_setting {} { 80 # Set up the following global list variables containing the names of
160 set ret 0 81 # various test scripts:
161 catch { 82 #
162 set ret [sqlite3_enable_shared_cache] 83 # $alltests
163 } 84 # $allquicktests
164 return $ret 85 #
86 set alltests [list]
87 foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
88 foreach f [glob -nocomplain $testdir/../ext/rtree/*.test] {
89 lappend alltests $f
90 }
91
92 if {$::tcl_platform(platform)!="unix"} {
93 set alltests [test_set $alltests -exclude crash.test crash2.test]
94 }
95 set alltests [test_set $alltests -exclude {
96 all.test async.test quick.test veryquick.test
97 memleak.test permutations.test soak.test fts3.test
98 mallocAll.test rtree.test
99 }]
100
101 set allquicktests [test_set $alltests -exclude {
102 async2.test async3.test backup_ioerr.test corrupt.test
103 corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test
104 crash6.test crash7.test delete3.test e_fts3.test fts3rnd.test
105 fkey_malloc.test fuzz.test fuzz3.test fuzz_malloc.test in2.test loadext.test
106 misc7.test mutex2.test notify2.test onefile.test pagerfault2.test
107 savepoint4.test savepoint6.test select9.test
108 speed1.test speed1p.test speed2.test speed3.test speed4.test
109 speed4p.test sqllimits1.test tkt2686.test thread001.test thread002.test
110 thread003.test thread004.test thread005.test trans2.test vacuum3.test
111 incrvacuum_ioerr.test autovacuum_crash.test btree8.test shared_err.test
112 vtab_err.test walslow.test walcrash.test
113 walthread.test rtree3.test
114 }]
115 if {[info exists ::env(QUICKTEST_INCLUDE)]} {
116 set allquicktests [concat $allquicktests $::env(QUICKTEST_INCLUDE)]
165 } 117 }
166 118
167 ############################################################################# 119 #############################################################################
168 # Start of tests 120 # Start of tests
121 #
122
123 #-------------------------------------------------------------------------
124 # Define the generic test suites:
125 #
126 # veryquick
127 # quick
128 # full
129 #
130 lappend ::testsuitelist xxx
131
132 test_suite "veryquick" -prefix "" -description {
133 "Very" quick test suite. Runs in less than 5 minutes on a workstation.
134 This test suite is the same as the "quick" tests, except that some files
135 that test malloc and IO errors are omitted.
136 } -files [
137 test_set $allquicktests -exclude *malloc* *ioerr* *fault*
138 ]
139
140 test_suite "quick" -prefix "" -description {
141 Quick test suite. Runs in around 10 minutes on a workstation.
142 } -files [
143 test_set $allquicktests
144 ]
145
146 test_suite "full" -prefix "" -description {
147 Full test suite. Takes a long time.
148 } -files [
149 test_set $alltests
150 ] -initialize {
151 unset -nocomplain ::G(isquick)
152 }
153
154 test_suite "threads" -prefix "" -description {
155 All multi-threaded tests.
156 } -files {
157 notify2.test thread001.test thread002.test thread003.test
158 thread004.test thread005.test walthread.test
159 }
160
161 test_suite "fts3" -prefix "" -description {
162 All FTS3 tests except fts3malloc.test and fts3rnd.test.
163 } -files {
164 fts3aa.test fts3ab.test fts3ac.test fts3ad.test fts3ae.test
165 fts3af.test fts3ag.test fts3ah.test fts3ai.test fts3aj.test
166 fts3ak.test fts3al.test fts3am.test fts3an.test fts3ao.test
167 fts3atoken.test fts3b.test fts3c.test fts3cov.test fts3d.test
168 fts3e.test fts3expr.test fts3expr2.test fts3near.test
169 fts3query.test fts3snippet.test
170 }
171
172
173 lappend ::testsuitelist xxx
174 #-------------------------------------------------------------------------
175 # Define the coverage related test suites:
176 #
177 # coverage-wal
178 #
179 test_suite "coverage-wal" -description {
180 Coverage tests for file wal.c.
181 } -files {
182 wal.test wal2.test wal3.test walmode.test
183 walbak.test walhook.test walcrash2.test walcksum.test
184 walfault.test walbig.test
185 }
186
187 test_suite "coverage-pager" -description {
188 Coverage tests for file pager.c.
189 } -files {
190 pager1.test pager2.test pagerfault.test pagerfault2.test
191 walfault.test walbak.test journal2.test tkt-9d68c883.test
192 }
193
194
195 lappend ::testsuitelist xxx
196 #-------------------------------------------------------------------------
197 # Define the permutation test suites:
198 #
169 199
170 # Run some tests using pre-allocated page and scratch blocks. 200 # Run some tests using pre-allocated page and scratch blocks.
171 # 201 #
172 run_tests "memsubsys1" -description { 202 test_suite "memsubsys1" -description {
173 Tests using pre-allocated page and scratch blocks 203 Tests using pre-allocated page and scratch blocks
174 } -exclude { 204 } -files [
175 ioerr5.test 205 test_set $::allquicktests -exclude ioerr5.test malloc5.test
176 malloc5.test 206 ] -initialize {
177 } -initialize {
178 catch {db close} 207 catch {db close}
179 sqlite3_shutdown 208 sqlite3_shutdown
180 sqlite3_config_pagecache 4096 24 209 sqlite3_config_pagecache 4096 24
181 sqlite3_config_scratch 25000 1 210 sqlite3_config_scratch 25000 1
182 sqlite3_initialize 211 sqlite3_initialize
183 autoinstall_test_functions 212 autoinstall_test_functions
184 } -shutdown { 213 } -shutdown {
185 catch {db close} 214 catch {db close}
186 sqlite3_shutdown 215 sqlite3_shutdown
187 sqlite3_config_pagecache 0 0 216 sqlite3_config_pagecache 0 0
188 sqlite3_config_scratch 0 0 217 sqlite3_config_scratch 0 0
189 sqlite3_initialize 218 sqlite3_initialize
190 autoinstall_test_functions 219 autoinstall_test_functions
191 } 220 }
192 221
193 # Run some tests using pre-allocated page and scratch blocks. This time 222 # Run some tests using pre-allocated page and scratch blocks. This time
194 # the allocations are too small to use in most cases. 223 # the allocations are too small to use in most cases.
195 # 224 #
196 # Both ioerr5.test and malloc5.test are excluded because they test the 225 # Both ioerr5.test and malloc5.test are excluded because they test the
197 # sqlite3_soft_heap_limit() and sqlite3_release_memory() functionality. 226 # sqlite3_soft_heap_limit() and sqlite3_release_memory() functionality.
198 # This functionality is disabled if a pre-allocated page block is provided. 227 # This functionality is disabled if a pre-allocated page block is provided.
199 # 228 #
200 run_tests "memsubsys2" -description { 229 test_suite "memsubsys2" -description {
201 Tests using small pre-allocated page and scratch blocks 230 Tests using small pre-allocated page and scratch blocks
202 } -exclude { 231 } -files [
203 ioerr5.test 232 test_set $::allquicktests -exclude ioerr5.test malloc5.test
204 malloc5.test 233 ] -initialize {
205 } -initialize {
206 catch {db close} 234 catch {db close}
207 sqlite3_shutdown 235 sqlite3_shutdown
208 sqlite3_config_pagecache 512 5 236 sqlite3_config_pagecache 512 5
209 sqlite3_config_scratch 1000 1 237 sqlite3_config_scratch 1000 1
210 sqlite3_initialize 238 sqlite3_initialize
211 autoinstall_test_functions 239 autoinstall_test_functions
212 } -shutdown { 240 } -shutdown {
213 catch {db close} 241 catch {db close}
214 sqlite3_shutdown 242 sqlite3_shutdown
215 sqlite3_config_pagecache 0 0 243 sqlite3_config_pagecache 0 0
216 sqlite3_config_scratch 0 0 244 sqlite3_config_scratch 0 0
217 sqlite3_initialize 245 sqlite3_initialize
218 autoinstall_test_functions 246 autoinstall_test_functions
219 } 247 }
220 248
221 # Run all tests with the lookaside allocator disabled. 249 # Run all tests with the lookaside allocator disabled.
222 # 250 #
223 run_tests "nolookaside" -description { 251 test_suite "nolookaside" -description {
224 OOM tests with lookaside disabled 252 OOM tests with lookaside disabled
225 } -initialize { 253 } -initialize {
226 catch {db close} 254 catch {db close}
227 sqlite3_shutdown 255 sqlite3_shutdown
228 sqlite3_config_lookaside 0 0 256 sqlite3_config_lookaside 0 0
229 sqlite3_initialize 257 sqlite3_initialize
230 autoinstall_test_functions 258 autoinstall_test_functions
231 } -shutdown { 259 } -shutdown {
232 catch {db close} 260 catch {db close}
233 sqlite3_shutdown 261 sqlite3_shutdown
234 sqlite3_config_lookaside 100 500 262 sqlite3_config_lookaside 100 500
235 sqlite3_initialize 263 sqlite3_initialize
236 autoinstall_test_functions 264 autoinstall_test_functions
237 } 265 } -files $::allquicktests
238 266
239 # Run some tests in SQLITE_CONFIG_SINGLETHREAD mode. 267 # Run some tests in SQLITE_CONFIG_SINGLETHREAD mode.
240 # 268 #
241 run_tests "singlethread" -description { 269 test_suite "singlethread" -description {
242 Tests run in SQLITE_CONFIG_SINGLETHREAD mode 270 Tests run in SQLITE_CONFIG_SINGLETHREAD mode
243 } -initialize { 271 } -initialize {
244 catch {db close} 272 catch {db close}
245 sqlite3_shutdown 273 sqlite3_shutdown
246 catch {sqlite3_config singlethread} 274 catch {sqlite3_config singlethread}
247 sqlite3_initialize 275 sqlite3_initialize
248 autoinstall_test_functions 276 autoinstall_test_functions
249 } -include { 277 } -files {
250 delete.test delete2.test insert.test rollback.test select1.test 278 delete.test delete2.test insert.test rollback.test select1.test
251 select2.test trans.test update.test vacuum.test types.test 279 select2.test trans.test update.test vacuum.test types.test
252 types2.test types3.test 280 types2.test types3.test
253 } -shutdown { 281 } -shutdown {
254 catch {db close} 282 catch {db close}
255 sqlite3_shutdown 283 sqlite3_shutdown
256 catch {sqlite3_config serialized} 284 catch {sqlite3_config serialized}
257 sqlite3_initialize 285 sqlite3_initialize
258 autoinstall_test_functions 286 autoinstall_test_functions
259 } 287 }
260 288
261 run_tests "nomutex" -description { 289 test_suite "nomutex" -description {
262 Tests run with the SQLITE_OPEN_MULTITHREADED flag passed to sqlite3_open(). 290 Tests run with the SQLITE_OPEN_MULTITHREADED flag passed to sqlite3_open().
263 } -initialize { 291 } -initialize {
264 rename sqlite3 sqlite3_nomutex 292 rename sqlite3 sqlite3_nomutex
265 proc sqlite3 {args} { 293 proc sqlite3 {args} {
266 if {[string range [lindex $args 0] 0 0] ne "-"} { 294 if {[string range [lindex $args 0] 0 0] ne "-"} {
267 lappend args -fullmutex 0 -nomutex 1 295 lappend args -fullmutex 0 -nomutex 1
268 } 296 }
269 uplevel [concat sqlite3_nomutex $args] 297 uplevel [concat sqlite3_nomutex $args]
270 } 298 }
271 } -include { 299 } -files {
272 delete.test delete2.test insert.test rollback.test select1.test 300 delete.test delete2.test insert.test rollback.test select1.test
273 select2.test trans.test update.test vacuum.test types.test 301 select2.test trans.test update.test vacuum.test types.test
274 types2.test types3.test 302 types2.test types3.test
275 } -shutdown { 303 } -shutdown {
276 rename sqlite3 {} 304 rename sqlite3 {}
277 rename sqlite3_nomutex sqlite3 305 rename sqlite3_nomutex sqlite3
278 } 306 }
279 307
280 # Run some tests in SQLITE_CONFIG_MULTITHREAD mode. 308 # Run some tests in SQLITE_CONFIG_MULTITHREAD mode.
281 # 309 #
282 run_tests "multithread" -description { 310 test_suite "multithread" -description {
283 Tests run in SQLITE_CONFIG_MULTITHREAD mode 311 Tests run in SQLITE_CONFIG_MULTITHREAD mode
284 } -initialize { 312 } -initialize {
285 catch {db close} 313 catch {db close}
286 sqlite3_shutdown 314 sqlite3_shutdown
287 catch {sqlite3_config multithread} 315 catch {sqlite3_config multithread}
288 sqlite3_initialize 316 sqlite3_initialize
289 autoinstall_test_functions 317 autoinstall_test_functions
290 } -include { 318 } -files {
291 delete.test delete2.test insert.test rollback.test select1.test 319 delete.test delete2.test insert.test rollback.test select1.test
292 select2.test trans.test update.test vacuum.test types.test 320 select2.test trans.test update.test vacuum.test types.test
293 types2.test types3.test 321 types2.test types3.test
294 } -shutdown { 322 } -shutdown {
295 catch {db close} 323 catch {db close}
296 sqlite3_shutdown 324 sqlite3_shutdown
297 catch {sqlite3_config serialized} 325 catch {sqlite3_config serialized}
298 sqlite3_initialize 326 sqlite3_initialize
299 autoinstall_test_functions 327 autoinstall_test_functions
300 } 328 }
301 329
302 # Run some tests in SQLITE_OPEN_FULLMUTEX mode. 330 # Run some tests in SQLITE_OPEN_FULLMUTEX mode.
303 # 331 #
304 run_tests "fullmutex" -description { 332 test_suite "fullmutex" -description {
305 Tests run in SQLITE_OPEN_FULLMUTEX mode 333 Tests run in SQLITE_OPEN_FULLMUTEX mode
306 } -initialize { 334 } -initialize {
307 rename sqlite3 sqlite3_fullmutex 335 rename sqlite3 sqlite3_fullmutex
308 proc sqlite3 {args} { 336 proc sqlite3 {args} {
309 if {[string range [lindex $args 0] 0 0] ne "-"} { 337 if {[string range [lindex $args 0] 0 0] ne "-"} {
310 lappend args -nomutex 0 -fullmutex 1 338 lappend args -nomutex 0 -fullmutex 1
311 } 339 }
312 uplevel [concat sqlite3_fullmutex $args] 340 uplevel [concat sqlite3_fullmutex $args]
313 } 341 }
314 } -include { 342 } -files {
315 delete.test delete2.test insert.test rollback.test select1.test 343 delete.test delete2.test insert.test rollback.test select1.test
316 select2.test trans.test update.test vacuum.test types.test 344 select2.test trans.test update.test vacuum.test types.test
317 types2.test types3.test 345 types2.test types3.test
318 } -shutdown { 346 } -shutdown {
319 rename sqlite3 {} 347 rename sqlite3 {}
320 rename sqlite3_fullmutex sqlite3 348 rename sqlite3_fullmutex sqlite3
321 } 349 }
322 350
323 # Run some tests using the "onefile" demo. 351 # Run some tests using the "onefile" demo.
324 # 352 #
325 run_tests "onefile" -description { 353 test_suite "onefile" -description {
326 Run some tests using the "test_onefile.c" demo 354 Run some tests using the "test_onefile.c" demo
327 } -initialize { 355 } -initialize {
328 rename sqlite3 sqlite3_onefile 356 rename sqlite3 sqlite3_onefile
329 proc sqlite3 {args} { 357 proc sqlite3 {args} {
330 if {[string range [lindex $args 0] 0 0] ne "-"} { 358 if {[string range [lindex $args 0] 0 0] ne "-"} {
331 lappend args -vfs fs 359 lappend args -vfs fs
332 } 360 }
333 uplevel [concat sqlite3_onefile $args] 361 uplevel [concat sqlite3_onefile $args]
334 } 362 }
335 } -include { 363 } -files {
336 conflict.test insert.test insert2.test insert3.test 364 conflict.test insert.test insert2.test insert3.test
337 rollback.test select1.test select2.test select3.test 365 rollback.test select1.test select2.test select3.test
338 } -shutdown { 366 } -shutdown {
339 rename sqlite3 {} 367 rename sqlite3 {}
340 rename sqlite3_onefile sqlite3 368 rename sqlite3_onefile sqlite3
341 } 369 }
342 370
343 # Run some tests using UTF-16 databases. 371 # Run some tests using UTF-16 databases.
344 # 372 #
345 run_tests "utf16" -description { 373 test_suite "utf16" -description {
346 Run tests using UTF-16 databases 374 Run tests using UTF-16 databases
347 } -presql { 375 } -presql {
348 pragma encoding = 'UTF-16' 376 pragma encoding = 'UTF-16'
349 } -include { 377 } -files {
350 alter.test alter3.test 378 alter.test alter3.test
351 auth.test bind.test blob.test capi2.test capi3.test collate1.test 379 auth.test bind.test blob.test capi2.test capi3.test collate1.test
352 collate2.test collate3.test collate4.test collate5.test collate6.test 380 collate2.test collate3.test collate4.test collate5.test collate6.test
353 conflict.test date.test delete.test expr.test fkey1.test func.test 381 conflict.test date.test delete.test expr.test fkey1.test func.test
354 hook.test index.test insert2.test insert.test interrupt.test in.test 382 hook.test index.test insert2.test insert.test interrupt.test in.test
355 intpkey.test ioerr.test join2.test join.test lastinsert.test 383 intpkey.test ioerr.test join2.test join.test lastinsert.test
356 laststmtchanges.test limit.test lock2.test lock.test main.test 384 laststmtchanges.test limit.test lock2.test lock.test main.test
357 memdb.test minmax.test misc1.test misc2.test misc3.test notnull.test 385 memdb.test minmax.test misc1.test misc2.test misc3.test notnull.test
358 null.test progress.test quote.test rowid.test select1.test select2.test 386 null.test progress.test quote.test rowid.test select1.test select2.test
359 select3.test select4.test select5.test select6.test sort.test 387 select3.test select4.test select5.test select6.test sort.test
360 subselect.test tableapi.test table.test temptable.test 388 subselect.test tableapi.test table.test temptable.test
361 trace.test trigger1.test trigger2.test trigger3.test 389 trace.test trigger1.test trigger2.test trigger3.test
362 trigger4.test types2.test types.test unique.test update.test 390 trigger4.test types2.test types.test unique.test update.test
363 vacuum.test view.test where.test 391 vacuum.test view.test where.test
364 } 392 }
365 393
366 # Run some tests in exclusive locking mode. 394 # Run some tests in exclusive locking mode.
367 # 395 #
368 run_tests "exclusive" -description { 396 test_suite "exclusive" -description {
369 Run tests in exclusive locking mode. 397 Run tests in exclusive locking mode.
370 } -presql { 398 } -presql {
371 pragma locking_mode = 'exclusive' 399 pragma locking_mode = 'exclusive'
372 } -include { 400 } -files {
373 rollback.test select1.test select2.test 401 rollback.test select1.test select2.test
374 malloc.test ioerr.test 402 malloc.test ioerr.test
375 } 403 }
376 404
377 # Run some tests in exclusive locking mode with truncated journals. 405 # Run some tests in exclusive locking mode with truncated journals.
378 # 406 #
379 run_tests "exclusive-truncate" -description { 407 test_suite "exclusive-truncate" -description {
380 Run tests in exclusive locking mode and truncate journal mode. 408 Run tests in exclusive locking mode and truncate journal mode.
381 } -presql { 409 } -presql {
382 pragma locking_mode = 'exclusive'; 410 pragma locking_mode = 'exclusive';
383 pragma journal_mode = TRUNCATE; 411 pragma journal_mode = TRUNCATE;
384 } -include { 412 } -files {
385 delete.test delete2.test insert.test rollback.test select1.test 413 delete.test delete2.test insert.test rollback.test select1.test
386 select2.test update.test malloc.test ioerr.test 414 select2.test update.test malloc.test ioerr.test
387 } 415 }
388 416
389 # Run some tests in persistent journal mode. 417 # Run some tests in persistent journal mode.
390 # 418 #
391 run_tests "persistent_journal" -description { 419 test_suite "persistent_journal" -description {
392 Run tests in persistent-journal mode. 420 Run tests in persistent-journal mode.
393 } -presql { 421 } -presql {
394 pragma journal_mode = persist 422 pragma journal_mode = persist
395 } -include { 423 } -files {
396 delete.test delete2.test insert.test rollback.test select1.test 424 delete.test delete2.test insert.test rollback.test select1.test
397 select2.test trans.test update.test vacuum.test 425 select2.test trans.test update.test vacuum.test
398 } 426 }
399 427
400 # Run some tests in truncating journal mode. 428 # Run some tests in truncating journal mode.
401 # 429 #
402 run_tests "truncate_journal" -description { 430 test_suite "truncate_journal" -description {
403 Run tests in persistent-journal mode. 431 Run tests in persistent-journal mode.
404 } -presql { 432 } -presql {
405 pragma journal_mode = truncate 433 pragma journal_mode = truncate
406 } -include { 434 } -files {
407 delete.test delete2.test insert.test rollback.test select1.test 435 delete.test delete2.test insert.test rollback.test select1.test
408 select2.test trans.test update.test vacuum.test 436 select2.test trans.test update.test vacuum.test
409 malloc.test ioerr.test 437 malloc.test ioerr.test
410 } 438 }
411 439
412 # Run some error tests in persistent journal mode. 440 # Run some error tests in persistent journal mode.
413 # 441 #
414 run_tests "persistent_journal_error" -description { 442 test_suite "persistent_journal_error" -description {
415 Run malloc.test and ioerr.test in persistent-journal mode. 443 Run malloc.test and ioerr.test in persistent-journal mode.
416 } -presql { 444 } -presql {
417 pragma journal_mode = persist 445 pragma journal_mode = persist
418 } -include { 446 } -files {
419 malloc.test ioerr.test 447 malloc.test ioerr.test
420 } 448 }
421 449
422 # Run some tests in no journal mode. 450 # Run some tests in no journal mode.
423 # 451 #
424 run_tests "no_journal" -description { 452 test_suite "no_journal" -description {
425 Run tests in no-journal mode. 453 Run tests in no-journal mode.
426 } -presql { 454 } -presql {
427 pragma journal_mode = persist 455 pragma journal_mode = persist
428 } -include { 456 } -files {
429 delete.test delete2.test insert.test rollback.test select1.test 457 delete.test delete2.test insert.test rollback.test select1.test
430 select2.test trans.test update.test vacuum.test 458 select2.test trans.test update.test vacuum.test
431 } 459 }
432 460
433 # Run some error tests in no journal mode. 461 # Run some error tests in no journal mode.
434 # 462 #
435 run_tests "no_journal_error" -description { 463 test_suite "no_journal_error" -description {
436 Run malloc.test and ioerr.test in no-journal mode. 464 Run malloc.test and ioerr.test in no-journal mode.
437 } -presql { 465 } -presql {
438 pragma journal_mode = persist 466 pragma journal_mode = persist
439 } -include { 467 } -files {
440 malloc.test ioerr.test 468 malloc.test ioerr.test
441 } 469 }
442 470
443 # Run some crash-tests in autovacuum mode. 471 # Run some crash-tests in autovacuum mode.
444 # 472 #
445 run_tests "autovacuum_crash" -description { 473 test_suite "autovacuum_crash" -description {
446 Run crash.test in autovacuum mode. 474 Run crash.test in autovacuum mode.
447 } -presql { 475 } -presql {
448 pragma auto_vacuum = 1 476 pragma auto_vacuum = 1
449 } -include crash.test 477 } -files crash.test
450 478
451 # Run some ioerr-tests in autovacuum mode. 479 # Run some ioerr-tests in autovacuum mode.
452 # 480 #
453 run_tests "autovacuum_ioerr" -description { 481 test_suite "autovacuum_ioerr" -description {
454 Run ioerr.test in autovacuum mode. 482 Run ioerr.test in autovacuum mode.
455 } -presql { 483 } -presql {
456 pragma auto_vacuum = 1 484 pragma auto_vacuum = 1
457 } -include ioerr.test 485 } -files ioerr.test
458 486
459 # Run tests with an in-memory journal. 487 # Run tests with an in-memory journal.
460 # 488 #
461 run_tests "inmemory_journal" -description { 489 test_suite "inmemory_journal" -description {
462 Run tests with an in-memory journal file. 490 Run tests with an in-memory journal file.
463 } -presql { 491 } -presql {
464 pragma journal_mode = 'memory' 492 pragma journal_mode = 'memory'
465 } -exclude { 493 } -files [test_set $::allquicktests -exclude {
466 # Exclude all tests that simulate IO errors. 494 # Exclude all tests that simulate IO errors.
467 autovacuum_ioerr2.test incrvacuum_ioerr.test ioerr.test 495 autovacuum_ioerr2.test incrvacuum_ioerr.test ioerr.test
468 ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test 496 ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test
469 vacuum3.test incrblob_err.test diskfull.test backup_ioerr.test 497 vacuum3.test incrblob_err.test diskfull.test backup_ioerr.test
498 e_fts3.test fts3cov.test fts3malloc.test fts3rnd.test
499 fts3snippet.test
470 500
471 # Exclude test scripts that use tcl IO to access journal files or count 501 # Exclude test scripts that use tcl IO to access journal files or count
472 # the number of fsync() calls. 502 # the number of fsync() calls.
473 pager.test exclusive.test jrnlmode.test sync.test misc1.test 503 pager.test exclusive.test jrnlmode.test sync.test misc1.test
474 journal1.test conflict.test crash8.test tkt3457.test io.test 504 journal1.test conflict.test crash8.test tkt3457.test io.test
475 } 505 journal3.test
506
507 pager1.test async4.test corrupt.test filefmt.test pager2.test
508 corrupt5.test corruptA.test pageropt.test
509
510 # Exclude stmt.test, which expects sub-journals to use temporary files.
511 stmt.test
512
513 # WAL mode is different.
514 wal*
515 }]
476 516
477 ifcapable mem3 { 517 ifcapable mem3 {
478 run_tests "memsys3" -description { 518 test_suite "memsys3" -description {
479 Run tests using the allocator in mem3.c. 519 Run tests using the allocator in mem3.c.
480 } -exclude { 520 } -files [test_set $::allquicktests -exclude {
481 autovacuum.test delete3.test manydb.test 521 autovacuum.test delete3.test manydb.test
482 bigrow.test incrblob2.test memdb.test 522 bigrow.test incrblob2.test memdb.test
483 bitvec.test index2.test memsubsys1.test 523 bitvec.test index2.test memsubsys1.test
484 capi3c.test ioerr.test memsubsys2.test 524 capi3c.test ioerr.test memsubsys2.test
485 capi3.test join3.test pagesize.test 525 capi3.test join3.test pagesize.test
486 collate5.test limit.test backup_ioerr.test 526 collate5.test limit.test backup_ioerr.test
487 backup_malloc.test 527 backup_malloc.test
488 } -initialize { 528 }] -initialize {
489 catch {db close} 529 catch {db close}
490 sqlite3_reset_auto_extension 530 sqlite3_reset_auto_extension
491 sqlite3_shutdown 531 sqlite3_shutdown
492 sqlite3_config_heap 25000000 0 532 sqlite3_config_heap 25000000 0
493 sqlite3_config_lookaside 0 0 533 sqlite3_config_lookaside 0 0
494 ifcapable mem5 { 534 ifcapable mem5 {
495 # If both memsys3 and memsys5 are enabled in the build, the call to 535 # If both memsys3 and memsys5 are enabled in the build, the call to
496 # [sqlite3_config_heap] will initialize the system to use memsys5. 536 # [sqlite3_config_heap] will initialize the system to use memsys5.
497 # The following overrides this preference and installs the memsys3 537 # The following overrides this preference and installs the memsys3
498 # allocator. 538 # allocator.
499 sqlite3_install_memsys3 539 sqlite3_install_memsys3
500 } 540 }
501 install_malloc_faultsim 1 541 install_malloc_faultsim 1
502 sqlite3_initialize 542 sqlite3_initialize
503 autoinstall_test_functions 543 autoinstall_test_functions
504 } -shutdown { 544 } -shutdown {
505 catch {db close} 545 catch {db close}
506 sqlite3_shutdown 546 sqlite3_shutdown
507 sqlite3_config_heap 0 0 547 sqlite3_config_heap 0 0
508 sqlite3_config_lookaside 100 500 548 sqlite3_config_lookaside 100 500
509 install_malloc_faultsim 1 549 install_malloc_faultsim 1
510 sqlite3_initialize 550 sqlite3_initialize
511 autoinstall_test_functions 551 autoinstall_test_functions
512 } 552 }
513 } 553 }
514 554
515 ifcapable mem5 { 555 ifcapable mem5 {
516 run_tests "memsys5" -description { 556 test_suite "memsys5" -description {
517 Run tests using the allocator in mem5.c. 557 Run tests using the allocator in mem5.c.
518 } -exclude { 558 } -files [test_set $::allquicktests -exclude {
519 autovacuum.test delete3.test manydb.test 559 autovacuum.test delete3.test manydb.test
520 bigrow.test incrblob2.test memdb.test 560 bigrow.test incrblob2.test memdb.test
521 bitvec.test index2.test memsubsys1.test 561 bitvec.test index2.test memsubsys1.test
522 capi3c.test ioerr.test memsubsys2.test 562 capi3c.test ioerr.test memsubsys2.test
523 capi3.test join3.test pagesize.test 563 capi3.test join3.test pagesize.test
524 collate5.test limit.test zeroblob.test 564 collate5.test limit.test zeroblob.test
525 } -initialize { 565 }] -initialize {
526 catch {db close} 566 catch {db close}
527 sqlite3_shutdown 567 sqlite3_shutdown
528 sqlite3_config_heap 25000000 64 568 sqlite3_config_heap 25000000 64
529 sqlite3_config_lookaside 0 0 569 sqlite3_config_lookaside 0 0
530 install_malloc_faultsim 1 570 install_malloc_faultsim 1
531 sqlite3_initialize 571 sqlite3_initialize
532 autoinstall_test_functions 572 autoinstall_test_functions
533 } -shutdown { 573 } -shutdown {
534 catch {db close} 574 catch {db close}
535 sqlite3_shutdown 575 sqlite3_shutdown
536 sqlite3_config_heap 0 0 576 sqlite3_config_heap 0 0
537 sqlite3_config_lookaside 100 500 577 sqlite3_config_lookaside 100 500
538 install_malloc_faultsim 1 578 install_malloc_faultsim 1
539 sqlite3_initialize 579 sqlite3_initialize
540 autoinstall_test_functions 580 autoinstall_test_functions
541 } 581 }
542 582
543 run_tests "memsys5-2" -description { 583 test_suite "memsys5-2" -description {
544 Run tests using the allocator in mem5.c in a different configuration. 584 Run tests using the allocator in mem5.c in a different configuration.
545 } -include { 585 } -files {
546 select1.test 586 select1.test
547 } -initialize { 587 } -initialize {
548 catch {db close} 588 catch {db close}
549 sqlite3_shutdown 589 sqlite3_shutdown
590 sqlite3_config_memstatus 0
550 sqlite3_config_heap 40000000 16 591 sqlite3_config_heap 40000000 16
551 sqlite3_config_lookaside 0 0 592 sqlite3_config_lookaside 0 0
552 install_malloc_faultsim 1 593 install_malloc_faultsim 1
553 sqlite3_initialize 594 sqlite3_initialize
554 autoinstall_test_functions 595 autoinstall_test_functions
555 } -shutdown { 596 } -shutdown {
556 catch {db close} 597 catch {db close}
557 sqlite3_shutdown 598 sqlite3_shutdown
558 sqlite3_config_heap 0 0 599 sqlite3_config_heap 0 0
559 sqlite3_config_lookaside 100 500 600 sqlite3_config_lookaside 100 500
560 install_malloc_faultsim 1 601 install_malloc_faultsim 1
561 sqlite3_initialize 602 sqlite3_initialize
562 autoinstall_test_functions 603 autoinstall_test_functions
563 } 604 }
564 } 605 }
565 606
566 ifcapable threadsafe { 607 ifcapable threadsafe {
567 run_tests "no_mutex_try" -description { 608 test_suite "no_mutex_try" -description {
568 The sqlite3_mutex_try() interface always fails 609 The sqlite3_mutex_try() interface always fails
569 } -exclude [concat $EXCLUDE mutex1.test mutex2.test] \ 610 } -files [
570 -initialize { 611 test_set $::allquicktests -exclude mutex1.test mutex2.test
612 ] -initialize {
571 catch {db close} 613 catch {db close}
572 sqlite3_shutdown 614 sqlite3_shutdown
573 install_mutex_counters 1 615 install_mutex_counters 1
574 set ::disable_mutex_try 1 616 set ::disable_mutex_try 1
575 sqlite3_initialize 617 sqlite3_initialize
576 autoinstall_test_functions 618 autoinstall_test_functions
577 } -shutdown { 619 } -shutdown {
578 catch {db close} 620 catch {db close}
579 sqlite3_shutdown 621 sqlite3_shutdown
580 install_mutex_counters 0 622 install_mutex_counters 0
(...skipping 15 matching lines...) Expand all
596 # $sql 638 # $sql
597 # " 639 # "
598 # set fd [open test.db-journal w] 640 # set fd [open test.db-journal w]
599 # puts $fd [string repeat 1234567890 100000] 641 # puts $fd [string repeat 1234567890 100000]
600 # close $fd 642 # close $fd
601 # eval sa_crashsql $options 643 # eval sa_crashsql $options
602 # } 644 # }
603 # } -shutdown { 645 # } -shutdown {
604 # rename crashsql {} 646 # rename crashsql {}
605 # rename sa_crashsql crashsql 647 # rename sa_crashsql crashsql
606 # } -include crash.test 648 # } -files crash.test
607 649
608 run_tests "safe_append" -description { 650 test_suite "safe_append" -description {
609 Run some tests on a SAFE_APPEND file-system. 651 Run some tests on a SAFE_APPEND file-system.
610 } -initialize { 652 } -initialize {
611 rename sqlite3 sqlite3_safeappend 653 rename sqlite3 sqlite3_safeappend
612 proc sqlite3 {args} { 654 proc sqlite3 {args} {
613 if {[string range [lindex $args 0] 0 0] ne "-"} { 655 if {[string range [lindex $args 0] 0 0] ne "-"} {
614 lappend args -vfs devsym 656 lappend args -vfs devsym
615 } 657 }
616 uplevel [concat sqlite3_safeappend $args] 658 uplevel [concat sqlite3_safeappend $args]
617 } 659 }
618 sqlite3_simulate_device -char safe_append 660 sqlite3_simulate_device -char safe_append
619 } -shutdown { 661 } -shutdown {
620 rename sqlite3 {} 662 rename sqlite3 {}
621 rename sqlite3_shutdown sqlite3 663 rename sqlite3_shutdown sqlite3
622 } -include [lsort [concat shared_err.test $ALLTESTS]] \ 664 } -files [
623 -exclude async3.test 665 test_set $::allquicktests shared_err.test -exclude async3.test
666 ]
624 667
625 # The set of tests to run on the alternative-pcache 668 # The set of tests to run on the alternative-pcache
626 set perm-alt-pcache-testset { 669 set perm-alt-pcache-testset {
627 async.test 670 async.test
628 attach.test 671 attach.test
629 delete.test delete2.test 672 delete.test delete2.test
630 index.test 673 index.test
631 insert.test insert2.test 674 insert.test insert2.test
632 join.test join2.test 675 join.test join2.test
633 rollback.test 676 rollback.test
634 select1.test select2.test 677 select1.test select2.test
635 trans.test 678 trans.test
636 update.test 679 update.test
637 } 680 }
638 681
639 run_tests "pcache0" -description { 682 foreach discard_rate {0 10 50 90 100} {
640 Alternative pcache implementation without random discard 683 test_suite "pcache${discard_rate}" -description "
684 Alternative pcache implementation with ${discard_rate}% random discard
685 " -initialize "
686 catch {db close}
687 sqlite3_shutdown
688 sqlite3_config_alt_pcache 1 $discard_rate 1
689 sqlite3_initialize
690 autoinstall_test_functions
691 " -shutdown {
692 catch {db close}
693 sqlite3_shutdown
694 sqlite3_config_alt_pcache 0 0 0
695 sqlite3_config_lookaside 100 500
696 install_malloc_faultsim 1
697 sqlite3_initialize
698 autoinstall_test_functions
699 } -files ${perm-alt-pcache-testset}
700 }
701
702 test_suite "journaltest" -description {
703 Check that pages are synced before being written (test_journal.c).
641 } -initialize { 704 } -initialize {
642 catch {db close} 705 catch {db close}
643 sqlite3_shutdown 706 register_jt_vfs -default ""
644 sqlite3_config_alt_pcache 1 0 1
645 sqlite3_initialize
646 autoinstall_test_functions
647 } -shutdown { 707 } -shutdown {
648 catch {db close} 708 unregister_jt_vfs
649 sqlite3_shutdown 709 } -files [test_set $::allquicktests -exclude {
650 sqlite3_config_alt_pcache 0 0 0 710 wal* incrvacuum.test ioerr.test corrupt4.test io.test crash8.test
651 sqlite3_config_lookaside 100 500 711 async4.test bigfile.test
652 install_malloc_faultsim 1 712 }]
653 sqlite3_initialize
654 autoinstall_test_functions
655 } -include ${perm-alt-pcache-testset}
656 713
657 run_tests "pcache10" -description { 714 if {[info commands register_demovfs] != ""} {
658 Alternative pcache implementation without 10% random discard 715 test_suite "demovfs" -description {
716 Check that the demovfs (code in test_demovfs.c) more or less works.
717 } -initialize {
718 register_demovfs
719 } -shutdown {
720 unregister_demovfs
721 } -files {
722 insert.test insert2.test insert3.test rollback.test
723 select1.test select2.test select3.test
724 }
725 }
726
727 test_suite "wal" -description {
728 Run tests with journal_mode=WAL
659 } -initialize { 729 } -initialize {
660 catch {db close} 730 set ::G(savepoint6_iterations) 100
661 sqlite3_shutdown
662 sqlite3_config_alt_pcache 1 50 1
663 sqlite3_initialize
664 autoinstall_test_functions
665 } -shutdown { 731 } -shutdown {
666 catch {db close} 732 unset -nocomplain ::G(savepoint6_iterations)
667 sqlite3_shutdown 733 } -files {
668 sqlite3_config_alt_pcache 0 0 0 734 savepoint.test savepoint2.test savepoint6.test
669 sqlite3_initialize 735 trans.test avtrans.test
670 autoinstall_test_functions
671 } -include ${perm-alt-pcache-testset}
672 736
673 run_tests "pcache50" -description { 737 fts3aa.test fts3ab.test fts3ac.test fts3ad.test
674 Alternative pcache implementation without 50% random discard 738 fts3ae.test fts3af.test fts3ag.test fts3ah.test
675 } -initialize { 739 fts3ai.test fts3aj.test fts3ak.test fts3al.test
676 catch {db close} 740 fts3am.test fts3an.test fts3ao.test fts3b.test
677 sqlite3_shutdown 741 fts3c.test fts3d.test fts3e.test fts3query.test
678 sqlite3_config_alt_pcache 1 50 1 742 }
679 sqlite3_initialize
680 autoinstall_test_functions
681 } -shutdown {
682 catch {db close}
683 sqlite3_shutdown
684 sqlite3_config_alt_pcache 0 0 0
685 sqlite3_initialize
686 autoinstall_test_functions
687 } -include ${perm-alt-pcache-testset}
688 743
689 run_tests "pcache90" -description { 744 test_suite "rtree" -description {
690 Alternative pcache implementation without 90% random discard 745 All R-tree related tests. Provides coverage of source file rtree.c.
691 } -initialize { 746 } -files [glob -nocomplain $::testdir/../ext/rtree/*.test]
692 catch {db close}
693 sqlite3_shutdown
694 sqlite3_config_alt_pcache 1 50 1
695 sqlite3_initialize
696 autoinstall_test_functions
697 } -shutdown {
698 catch {db close}
699 sqlite3_shutdown
700 sqlite3_config_alt_pcache 0 0 0
701 sqlite3_initialize
702 autoinstall_test_functions
703 } -include ${perm-alt-pcache-testset}
704
705 run_tests "pcache100" -description {
706 Alternative pcache implementation that always discards when unpinning
707 } -initialize {
708 catch {db close}
709 sqlite3_shutdown
710 sqlite3_config_alt_pcache 1 100 1
711 sqlite3_initialize
712 autoinstall_test_functions
713 } -shutdown {
714 catch {db close}
715 sqlite3_shutdown
716 sqlite3_config_alt_pcache 0 0 0
717 sqlite3_initialize
718 autoinstall_test_functions
719 } -include ${perm-alt-pcache-testset}
720
721 run_tests "journaltest" -description {
722 Check that pages are synced before being written (test_journal.c).
723 } -initialize {
724 set ISQUICK 1
725 catch {db close}
726 register_jt_vfs -default ""
727 #sqlite3_instvfs binarylog -default binarylog ostrace.bin
728 } -shutdown {
729 #sqlite3_instvfs destroy binarylog
730 unregister_jt_vfs
731 } -include [concat $::ALLTESTS savepoint6.test
732 ] -exclude {
733 incrvacuum.test
734 ioerr.test
735 corrupt4.test
736 io.test
737 crash8.test
738 async4.test
739 }
740 747
741 # End of tests 748 # End of tests
742 ############################################################################# 749 #############################################################################
743 750
744 if {$::perm::testmode eq "targets"} { puts "" ; exit } 751 # run_tests NAME OPTIONS
752 #
753 # where available options are:
754 #
755 # -description TITLE
756 # -initialize SCRIPT
757 # -shutdown SCRIPT
758 # -presql SQL
759 # -files LIST-OF-FILES
760 # -prefix NAME
761 #
762 proc run_tests {name args} {
763 array set options $args
745 764
746 # Restore the [sqlite3] command. 765 set ::G(perm:name) $name
747 # 766 set ::G(perm:prefix) $options(-prefix)
748 rename sqlite3 {} 767 set ::G(perm:presql) $options(-presql)
749 rename really_sqlite3 sqlite3 768 set ::G(isquick) 1
750 769
751 # Restore the [finish_test] command. 770 uplevel $options(-initialize)
752 #
753 rename finish_test ""
754 rename really_finish_test2 finish_test
755 771
756 # Restore the [do_test] command. 772 foreach file [lsort $options(-files)] {
757 # 773 if {[file tail $file] == $file} { set file [file join $::testdir $file] }
758 rename do_test "" 774 slave_test_file $file
759 rename really_do_test do_test 775 }
760 776
761 finish_test 777 uplevel $options(-shutdown)
778
779 unset ::G(perm:name)
780 unset ::G(perm:prefix)
781 unset ::G(perm:presql)
782 }
783
784 proc run_test_suite {name} {
785 if {[info exists ::testspec($name)]==0} {
786 error "No such test suite: $name"
787 }
788 uplevel run_tests $name $::testspec($name)
789 }
790
791 proc help {} {
792 puts "Usage: $::argv0 TESTSUITE ?TESTFILE?"
793 puts ""
794 puts "Available test-suites are:"
795 foreach k $::testsuitelist {
796 if {[info exists ::testspec($k)]==0} {
797 puts " ----------------------------------------"
798 puts ""
799 } else {
800 array set o $::testspec($k)
801 puts "Test suite: \"$k\""
802 set d [string trim $o(-description)]
803 set d [regsub {\n *} $d "\n "]
804 puts " $d"
805 puts ""
806 }
807 }
808 exit -1
809 }
810
811 if {[info script] == $argv0} {
812 proc main {argv} {
813 if {[llength $argv]==0} {
814 help
815 } else {
816 set suite [lindex $argv 0]
817 if {[info exists ::testspec($suite)]==0} help
818 set extra ""
819 if {[llength $argv]>1} { set extra [list -files [lrange $argv 1 end]] }
820 eval run_tests $suite $::testspec($suite) $extra
821 }
822 }
823 main $argv
824 finish_test
825 }
826
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/pcache.test ('k') | third_party/sqlite/src/test/pragma.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698