blob: a4d25903ca859bbc8040f09d5de432940c4d1d0d [file] [log] [blame]
drhb19a2bc2001-09-16 00:13:26 +00001#
2# May you do good and not evil.
3# May you find forgiveness for yourself and forgive others.
4# May you share freely, never taking more than you give.
5#
6#***********************************************************************
7# This file runs all tests.
8#
danielk197771bc31c2008-06-26 08:29:34 +00009# $Id: quick.test,v 1.84 2008/06/26 08:29:35 danielk1977 Exp $
danielk1977aef0bf62005-12-30 16:28:01 +000010
11proc lshift {lvar} {
12 upvar $lvar l
13 set ret [lindex $l 0]
14 set l [lrange $l 1 end]
15 return $ret
16}
17while {[set arg [lshift argv]] != ""} {
18 switch -- $arg {
19 -sharedpagercache {
20 sqlite3_enable_shared_cache 1
21 }
drh44548ec2007-06-18 12:22:43 +000022 -soak {
23 set SOAKTEST 1
24 }
danielk19775f096132008-03-28 15:44:09 +000025 -start {
26 set STARTAT "[lshift argv]*"
27 }
danielk1977aef0bf62005-12-30 16:28:01 +000028 default {
29 set argv [linsert $argv 0 $arg]
30 break
31 }
32 }
33}
drhb19a2bc2001-09-16 00:13:26 +000034
35set testdir [file dirname $argv0]
36source $testdir/tester.tcl
37rename finish_test really_finish_test
38proc finish_test {} {}
drh193a6b42002-07-07 16:52:46 +000039set ISQUICK 1
drhb19a2bc2001-09-16 00:13:26 +000040
41set EXCLUDE {
42 all.test
danielk197713a68c32005-12-15 10:11:30 +000043 async.test
danielk1977750b03e2006-02-14 10:48:39 +000044 async2.test
danielk197771bc31c2008-06-26 08:29:34 +000045 async3.test
drhee696e22004-08-30 16:52:17 +000046 corrupt.test
47 crash.test
danielk197759a33f92007-03-17 10:26:59 +000048 crash2.test
danielk19776897ca32007-08-23 16:27:21 +000049 crash3.test
drh04adf412008-01-08 18:57:50 +000050 crash4.test
danielk1977ff3c8982008-06-25 17:54:53 +000051 crash5.test
danielk197767c007b2008-03-20 04:45:49 +000052 crash6.test
danielk197781a392f2008-03-20 16:26:48 +000053 crash7.test
danielk1977ff3c8982008-06-25 17:54:53 +000054 delete3.test
drh613a0fe2007-11-23 17:31:17 +000055 fts3.test
danielk1977def0fec2007-05-10 15:37:52 +000056 fuzz.test
danielk1977c9cf9012007-05-30 10:36:47 +000057 fuzz_malloc.test
danielk19774aeff622007-05-12 09:30:47 +000058 in2.test
danielk197769e777f2006-06-14 10:38:02 +000059 loadext.test
drh4b59ab52002-08-24 18:24:51 +000060 memleak.test
danielk1977393f0682007-03-31 10:00:48 +000061 misc7.test
drh94e92032003-02-16 22:21:32 +000062 misuse.test
danielk197759f8c082008-06-18 17:09:10 +000063 mutex2.test
danielk1977a15db352007-09-14 16:20:00 +000064 onefile.test
danielk1977959e3a92008-06-21 12:15:04 +000065 permutations.test
drhee696e22004-08-30 16:52:17 +000066 quick.test
danielk19779afe6842008-06-24 11:21:20 +000067 select9.test
danielk19775453b8d2007-05-30 08:18:04 +000068 soak.test
drh3590f152006-11-23 21:09:10 +000069 speed1.test
drh45c236d2008-03-22 01:08:00 +000070 speed1p.test
drhe4dd73b2007-03-26 13:48:12 +000071 speed2.test
drh26c9b5e2008-04-11 14:56:53 +000072 speed3.test
danielk19770d6e7a02007-10-23 10:25:30 +000073 speed4.test
drh26c9b5e2008-04-11 14:56:53 +000074 speed4p.test
danielk1977b0ab63c2007-05-08 15:59:05 +000075 sqllimits1.test
danielk1977ff3c8982008-06-25 17:54:53 +000076 tkt2686.test
danielk1977e9dcd5e2007-09-10 10:53:01 +000077 thread001.test
78 thread002.test
danielk1977ff3c8982008-06-25 17:54:53 +000079 vacuum3.test
danielk1977e9dcd5e2007-09-10 10:53:01 +000080
danielk1977b4626a32007-04-28 15:47:43 +000081 incrvacuum_ioerr.test
danielk197794daf7f2004-11-08 09:26:09 +000082 autovacuum_crash.test
danielk1977ce9a7b12004-11-13 13:19:56 +000083 btree8.test
danielk197707cb5602006-01-20 10:55:05 +000084 shared_err.test
danielk1977be718892006-06-23 08:05:19 +000085 vtab_err.test
drh9e6675f2008-03-31 23:51:35 +000086 veryquick.test
danielk1977ff3c8982008-06-25 17:54:53 +000087 mallocAll.test
drhb19a2bc2001-09-16 00:13:26 +000088}
89
drhef4ac8f2004-06-19 00:16:31 +000090if {[sqlite3 -has-codec]} {
drh25d65432004-07-22 15:02:25 +000091 # lappend EXCLUDE \
92 # conflict.test
drh9eb9e262004-02-11 02:18:05 +000093}
94
drhb900aaf2006-11-09 00:24:53 +000095
96# Files to include in the test. If this list is empty then everything
97# that is not in the EXCLUDE list is run.
98#
99set INCLUDE {
100}
101
drhb19a2bc2001-09-16 00:13:26 +0000102foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
danielk1977ff3c8982008-06-25 17:54:53 +0000103 # If this is "veryquick.test", do not run any of the malloc or
104 # IO error simulations.
105 if {[info exists ISVERYQUICK] && (
106 [string match *malloc* $testfile] || [string match *ioerr* $testfile]
107 ) } {
108 continue
109 }
110
drhb19a2bc2001-09-16 00:13:26 +0000111 set tail [file tail $testfile]
112 if {[lsearch -exact $EXCLUDE $tail]>=0} continue
drhb900aaf2006-11-09 00:24:53 +0000113 if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
danielk19775f096132008-03-28 15:44:09 +0000114 if {[info exists STARTAT] && [string match $STARTAT $tail]} {unset STARTAT}
115 if {[info exists STARTAT]} continue
drhb19a2bc2001-09-16 00:13:26 +0000116 source $testfile
drh94e92032003-02-16 22:21:32 +0000117 catch {db close}
118 if {$sqlite_open_file_count>0} {
119 puts "$tail did not close all files: $sqlite_open_file_count"
120 incr nErr
121 lappend ::failList $tail
drh5ea2df92007-04-16 17:07:55 +0000122 set sqlite_open_file_count 0
123 }
drhb19a2bc2001-09-16 00:13:26 +0000124}
danielk1977ff3c8982008-06-25 17:54:53 +0000125#set argv quick
126#source $testdir/permutations.test
127#set argv ""
danielk1977c8c11582004-06-29 13:41:21 +0000128source $testdir/misuse.test
drhb19a2bc2001-09-16 00:13:26 +0000129
drh94e92032003-02-16 22:21:32 +0000130set sqlite_open_file_count 0
drhb19a2bc2001-09-16 00:13:26 +0000131really_finish_test