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

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

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