sl@0
|
1 |
#
|
sl@0
|
2 |
# May you do good and not evil.
|
sl@0
|
3 |
# May you find forgiveness for yourself and forgive others.
|
sl@0
|
4 |
# May you share freely, never taking more than you give.
|
sl@0
|
5 |
#
|
sl@0
|
6 |
#***********************************************************************
|
sl@0
|
7 |
# This file runs all out-of-memory tests.
|
sl@0
|
8 |
#
|
sl@0
|
9 |
# $Id: mallocAll.test,v 1.1 2007/11/26 13:36:00 drh Exp $
|
sl@0
|
10 |
|
sl@0
|
11 |
proc lshift {lvar} {
|
sl@0
|
12 |
upvar $lvar l
|
sl@0
|
13 |
set ret [lindex $l 0]
|
sl@0
|
14 |
set l [lrange $l 1 end]
|
sl@0
|
15 |
return $ret
|
sl@0
|
16 |
}
|
sl@0
|
17 |
while {[set arg [lshift argv]] != ""} {
|
sl@0
|
18 |
switch -- $arg {
|
sl@0
|
19 |
-sharedpagercache {
|
sl@0
|
20 |
sqlite3_enable_shared_cache 1
|
sl@0
|
21 |
}
|
sl@0
|
22 |
default {
|
sl@0
|
23 |
set argv [linsert $argv 0 $arg]
|
sl@0
|
24 |
break
|
sl@0
|
25 |
}
|
sl@0
|
26 |
}
|
sl@0
|
27 |
}
|
sl@0
|
28 |
|
sl@0
|
29 |
set testdir [file dirname $argv0]
|
sl@0
|
30 |
source $testdir/tester.tcl
|
sl@0
|
31 |
rename finish_test really_finish_test
|
sl@0
|
32 |
proc finish_test {} {}
|
sl@0
|
33 |
set ISQUICK 1
|
sl@0
|
34 |
|
sl@0
|
35 |
set EXCLUDE {
|
sl@0
|
36 |
mallocAll.test
|
sl@0
|
37 |
}
|
sl@0
|
38 |
|
sl@0
|
39 |
if {[sqlite3 -has-codec]} {
|
sl@0
|
40 |
# lappend EXCLUDE \
|
sl@0
|
41 |
# conflict.test
|
sl@0
|
42 |
}
|
sl@0
|
43 |
|
sl@0
|
44 |
|
sl@0
|
45 |
# Files to include in the test. If this list is empty then everything
|
sl@0
|
46 |
# that is not in the EXCLUDE list is run.
|
sl@0
|
47 |
#
|
sl@0
|
48 |
set INCLUDE {
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
foreach testfile [lsort -dictionary [glob $testdir/*malloc*.test]] {
|
sl@0
|
52 |
set tail [file tail $testfile]
|
sl@0
|
53 |
if {[lsearch -exact $EXCLUDE $tail]>=0} continue
|
sl@0
|
54 |
if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
|
sl@0
|
55 |
source $testfile
|
sl@0
|
56 |
catch {db close}
|
sl@0
|
57 |
if {$sqlite_open_file_count>0} {
|
sl@0
|
58 |
puts "$tail did not close all files: $sqlite_open_file_count"
|
sl@0
|
59 |
incr nErr
|
sl@0
|
60 |
lappend ::failList $tail
|
sl@0
|
61 |
set sqlite_open_file_count 0
|
sl@0
|
62 |
}
|
sl@0
|
63 |
}
|
sl@0
|
64 |
source $testdir/misuse.test
|
sl@0
|
65 |
|
sl@0
|
66 |
set sqlite_open_file_count 0
|
sl@0
|
67 |
really_finish_test
|