diff options
author | dan miller | 2007-10-20 02:49:29 +0000 |
---|---|---|
committer | dan miller | 2007-10-20 02:49:29 +0000 |
commit | e36d23a85ebff914d74bb541558c2b6082b78edb (patch) | |
tree | 54b58fdf162e78af64055282a6035c8d2443389d /libraries/sqlite/unix/sqlite-3.5.1/test/all.test | |
parent | * Fixed an issue whereby avatar chat distances were being calculated against ... (diff) | |
download | opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.zip opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.gz opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.bz2 opensim-SC-e36d23a85ebff914d74bb541558c2b6082b78edb.tar.xz |
sqlite source (unix build) added to libraries
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/all.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/all.test | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/all.test b/libraries/sqlite/unix/sqlite-3.5.1/test/all.test new file mode 100644 index 0000000..dbdce76 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/all.test | |||
@@ -0,0 +1,149 @@ | |||
1 | # 2001 September 15 | ||
2 | # | ||
3 | # The author disclaims copyright to this source code. In place of | ||
4 | # a legal notice, here is a blessing: | ||
5 | # | ||
6 | # May you do good and not evil. | ||
7 | # May you find forgiveness for yourself and forgive others. | ||
8 | # May you share freely, never taking more than you give. | ||
9 | # | ||
10 | #*********************************************************************** | ||
11 | # This file runs all tests. | ||
12 | # | ||
13 | # $Id: all.test,v 1.48 2007/09/01 11:04:28 danielk1977 Exp $ | ||
14 | |||
15 | set testdir [file dirname $argv0] | ||
16 | source $testdir/tester.tcl | ||
17 | rename finish_test really_finish_test | ||
18 | proc finish_test {} { | ||
19 | # no-op | ||
20 | } | ||
21 | |||
22 | if {[file exists ./sqlite_test_count]} { | ||
23 | set COUNT [exec cat ./sqlite_test_count] | ||
24 | } else { | ||
25 | set COUNT 3 | ||
26 | } | ||
27 | |||
28 | if {[llength $argv]>0} { | ||
29 | foreach {name value} $argv { | ||
30 | switch -- $name { | ||
31 | -count { | ||
32 | set COUNT $value | ||
33 | } | ||
34 | -quick { | ||
35 | set ISQUICK $value | ||
36 | } | ||
37 | -soak { | ||
38 | set SOAKTEST $value | ||
39 | } | ||
40 | default { | ||
41 | puts stderr "Unknown option: $name" | ||
42 | exit | ||
43 | } | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | set argv {} | ||
48 | |||
49 | # LeakList will hold a list of the number of unfreed mallocs after | ||
50 | # each round of the test. This number should be constant. If it | ||
51 | # grows, it may mean there is a memory leak in the library. | ||
52 | # | ||
53 | set LeakList {} | ||
54 | |||
55 | set EXCLUDE {} | ||
56 | lappend EXCLUDE all.test ;# This file | ||
57 | lappend EXCLUDE async.test | ||
58 | lappend EXCLUDE crash.test ;# Run seperately later. | ||
59 | lappend EXCLUDE crash2.test ;# Run seperately later. | ||
60 | lappend EXCLUDE autovacuum_crash.test ;# Run seperately later. | ||
61 | lappend EXCLUDE quick.test ;# Alternate test driver script | ||
62 | lappend EXCLUDE malloc.test ;# Run seperately later. | ||
63 | lappend EXCLUDE misuse.test ;# Run seperately later. | ||
64 | lappend EXCLUDE memleak.test ;# Alternate test driver script | ||
65 | lappend EXCLUDE fuzz.test | ||
66 | lappend EXCLUDE soak.test ;# Takes a very long time (default 1 hr) | ||
67 | |||
68 | # Files to include in the test. If this list is empty then everything | ||
69 | # that is not in the EXCLUDE list is run. | ||
70 | # | ||
71 | set INCLUDE { | ||
72 | } | ||
73 | |||
74 | # Test files btree2.test and btree4.test don't work if the | ||
75 | # SQLITE_DEFAULT_AUTOVACUUM macro is defined to true (because they depend | ||
76 | # on tables being allocated starting at page 2). | ||
77 | # | ||
78 | ifcapable default_autovacuum { | ||
79 | lappend EXCLUDE btree2.test | ||
80 | lappend EXCLUDE btree4.test | ||
81 | } | ||
82 | |||
83 | for {set Counter 0} {$Counter<$COUNT && $nErr==0} {incr Counter} { | ||
84 | if {$Counter%2} { | ||
85 | set ::SETUP_SQL {PRAGMA default_synchronous=off;} | ||
86 | } else { | ||
87 | catch {unset ::SETUP_SQL} | ||
88 | } | ||
89 | foreach testfile [lsort -dictionary [glob $testdir/*.test]] { | ||
90 | set tail [file tail $testfile] | ||
91 | if {[lsearch -exact $EXCLUDE $tail]>=0} continue | ||
92 | if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue | ||
93 | source $testfile | ||
94 | catch {db close} | ||
95 | if {$sqlite_open_file_count>0} { | ||
96 | puts "$tail did not close all files: $sqlite_open_file_count" | ||
97 | incr nErr | ||
98 | lappend ::failList $tail | ||
99 | set sqlite_open_file_count 0 | ||
100 | } | ||
101 | } | ||
102 | if {[info exists Leak]} { | ||
103 | lappend LeakList $Leak | ||
104 | } | ||
105 | } | ||
106 | |||
107 | # Do one last test to look for a memory leak in the library. This will | ||
108 | # only work if SQLite is compiled with the -DSQLITE_DEBUG=1 flag. | ||
109 | # | ||
110 | if {$LeakList!=""} { | ||
111 | puts -nonewline memory-leak-test... | ||
112 | incr ::nTest | ||
113 | foreach x $LeakList { | ||
114 | if {$x!=[lindex $LeakList 0]} { | ||
115 | puts " failed!" | ||
116 | puts "Expected: all values to be the same" | ||
117 | puts " Got: $LeakList" | ||
118 | incr ::nErr | ||
119 | lappend ::failList memory-leak-test | ||
120 | break | ||
121 | } | ||
122 | } | ||
123 | puts " Ok" | ||
124 | } | ||
125 | |||
126 | # Run the crashtest only on unix and only once. If the library does not | ||
127 | # always create auto-vacuum databases, also run autovacuum_crash.test. | ||
128 | # | ||
129 | if {$::tcl_platform(platform)=="unix"} { | ||
130 | source $testdir/crash.test | ||
131 | source $testdir/crash2.test | ||
132 | ifcapable !default_autovacuum { | ||
133 | source $testdir/autovacuum_crash.test | ||
134 | } | ||
135 | } | ||
136 | |||
137 | # Run the malloc tests and the misuse test after memory leak detection. | ||
138 | # Both tests leak memory. Currently, misuse.test also leaks a handful of | ||
139 | # file descriptors. This is not considered a problem, but can cause tests | ||
140 | # in malloc.test to fail. So set the open-file count to zero before running | ||
141 | # malloc.test to get around this. | ||
142 | # | ||
143 | catch {source $testdir/misuse.test} | ||
144 | set sqlite_open_file_count 0 | ||
145 | catch {source $testdir/malloc.test} | ||
146 | |||
147 | catch {db close} | ||
148 | set sqlite_open_file_count 0 | ||
149 | really_finish_test | ||