blob: 847756f9411739d26a79cfd5beecdd1efc8b5a93 [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#
dan430e74c2010-06-07 17:47:26 +00009
10set testdir [file dirname $argv0]
11source $testdir/tester.tcl
12db close
danielk1977aef0bf62005-12-30 16:28:01 +000013
14proc lshift {lvar} {
15 upvar $lvar l
16 set ret [lindex $l 0]
17 set l [lrange $l 1 end]
18 return $ret
19}
20while {[set arg [lshift argv]] != ""} {
21 switch -- $arg {
22 -sharedpagercache {
23 sqlite3_enable_shared_cache 1
24 }
drh44548ec2007-06-18 12:22:43 +000025 -soak {
dan430e74c2010-06-07 17:47:26 +000026 set G(issoak) 1
drh44548ec2007-06-18 12:22:43 +000027 }
danielk19775f096132008-03-28 15:44:09 +000028 -start {
29 set STARTAT "[lshift argv]*"
30 }
danielk1977aef0bf62005-12-30 16:28:01 +000031 default {
32 set argv [linsert $argv 0 $arg]
33 break
34 }
35 }
36}
drhb19a2bc2001-09-16 00:13:26 +000037
dan430e74c2010-06-07 17:47:26 +000038set G(isquick) 1
drhb19a2bc2001-09-16 00:13:26 +000039
40set EXCLUDE {
41 all.test
danielk197713a68c32005-12-15 10:11:30 +000042 async.test
danielk1977750b03e2006-02-14 10:48:39 +000043 async2.test
danielk197771bc31c2008-06-26 08:29:34 +000044 async3.test
danielk197704103022009-02-03 16:51:24 +000045 backup_ioerr.test
drhee696e22004-08-30 16:52:17 +000046 corrupt.test
drh959403f2008-12-12 17:56:16 +000047 corruptC.test
drhee696e22004-08-30 16:52:17 +000048 crash.test
danielk197759a33f92007-03-17 10:26:59 +000049 crash2.test
danielk19776897ca32007-08-23 16:27:21 +000050 crash3.test
drh04adf412008-01-08 18:57:50 +000051 crash4.test
danielk1977ff3c8982008-06-25 17:54:53 +000052 crash5.test
danielk197767c007b2008-03-20 04:45:49 +000053 crash6.test
danielk197781a392f2008-03-20 16:26:48 +000054 crash7.test
danielk1977ff3c8982008-06-25 17:54:53 +000055 delete3.test
dane2e51452009-12-03 17:36:22 +000056 e_fts3.test
drh613a0fe2007-11-23 17:31:17 +000057 fts3.test
dan64eac552009-12-04 05:41:03 +000058 fts3rnd.test
danf59c5ca2009-09-22 16:55:38 +000059 fkey_malloc.test
danielk1977def0fec2007-05-10 15:37:52 +000060 fuzz.test
danielk1977f2fb0442008-09-09 18:28:06 +000061 fuzz3.test
danielk1977c9cf9012007-05-30 10:36:47 +000062 fuzz_malloc.test
danielk19774aeff622007-05-12 09:30:47 +000063 in2.test
danielk197769e777f2006-06-14 10:38:02 +000064 loadext.test
drh4b59ab52002-08-24 18:24:51 +000065 memleak.test
danielk1977393f0682007-03-31 10:00:48 +000066 misc7.test
drh94e92032003-02-16 22:21:32 +000067 misuse.test
danielk197759f8c082008-06-18 17:09:10 +000068 mutex2.test
danielk1977d52acb32009-03-16 14:48:18 +000069 notify2.test
danielk1977a15db352007-09-14 16:20:00 +000070 onefile.test
danielk1977959e3a92008-06-21 12:15:04 +000071 permutations.test
drhee696e22004-08-30 16:52:17 +000072 quick.test
danielk1977488af092008-12-19 16:31:11 +000073 savepoint4.test
danielk1977e7e6f122009-01-03 10:41:29 +000074 savepoint6.test
danielk19779afe6842008-06-24 11:21:20 +000075 select9.test
danielk19775453b8d2007-05-30 08:18:04 +000076 soak.test
drh3590f152006-11-23 21:09:10 +000077 speed1.test
drh45c236d2008-03-22 01:08:00 +000078 speed1p.test
drhe4dd73b2007-03-26 13:48:12 +000079 speed2.test
drh26c9b5e2008-04-11 14:56:53 +000080 speed3.test
danielk19770d6e7a02007-10-23 10:25:30 +000081 speed4.test
drh26c9b5e2008-04-11 14:56:53 +000082 speed4p.test
danielk1977b0ab63c2007-05-08 15:59:05 +000083 sqllimits1.test
danielk1977ff3c8982008-06-25 17:54:53 +000084 tkt2686.test
danielk1977e9dcd5e2007-09-10 10:53:01 +000085 thread001.test
86 thread002.test
danielk197751d2d032008-08-28 08:31:48 +000087 thread003.test
danielk197702b4e3b2009-02-26 07:15:59 +000088 thread004.test
danielk197720736d82009-03-12 14:43:27 +000089 thread005.test
drh255538e2008-08-27 18:56:36 +000090 trans2.test
danielk1977ff3c8982008-06-25 17:54:53 +000091 vacuum3.test
danielk1977e9dcd5e2007-09-10 10:53:01 +000092
danielk1977b4626a32007-04-28 15:47:43 +000093 incrvacuum_ioerr.test
danielk197794daf7f2004-11-08 09:26:09 +000094 autovacuum_crash.test
danielk1977ce9a7b12004-11-13 13:19:56 +000095 btree8.test
danielk197707cb5602006-01-20 10:55:05 +000096 shared_err.test
danielk1977be718892006-06-23 08:05:19 +000097 vtab_err.test
drh9e6675f2008-03-31 23:51:35 +000098 veryquick.test
danielk1977ff3c8982008-06-25 17:54:53 +000099 mallocAll.test
dan9281bf22010-04-13 11:18:40 +0000100
101 walslow.test
102 walcrash.test
dan80a15262010-04-13 11:45:31 +0000103 walthread.test
drhb19a2bc2001-09-16 00:13:26 +0000104}
105
drhef4ac8f2004-06-19 00:16:31 +0000106if {[sqlite3 -has-codec]} {
drh25d65432004-07-22 15:02:25 +0000107 # lappend EXCLUDE \
108 # conflict.test
drh9eb9e262004-02-11 02:18:05 +0000109}
110
drhb900aaf2006-11-09 00:24:53 +0000111
112# Files to include in the test. If this list is empty then everything
113# that is not in the EXCLUDE list is run.
114#
115set INCLUDE {
116}
117
danielk1977d52acb32009-03-16 14:48:18 +0000118# If the QUICKTEST_INCLUDE environment variable is set, then interpret
119# it as a list of test files. Always run these files, even if they
120# begin with "malloc*" or "ioerr*" or are part of the EXCLUDE list
121# defined above.
122#
123set QUICKTEST_INCLUDE {}
124catch { set QUICKTEST_INCLUDE $env(QUICKTEST_INCLUDE) }
danielk1977ff3c8982008-06-25 17:54:53 +0000125
dan430e74c2010-06-07 17:47:26 +0000126# Run all test files in directory $testdir, subject to the following:
127#
128# 1. If a test file is specified as part of the $INCLUDE or
129# $QUICKTEST_INCLUDE list variables, run it.
130#
131# 2. If $INCLUDE is non-empty, and rule 1 does not apply to it, do not run it.
132#
133# 3. If a test file is specified as part of $EXCLUDE, and rule 1 does not
134# apply, do not run it.
135#
danielk1977d52acb32009-03-16 14:48:18 +0000136foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
drhb19a2bc2001-09-16 00:13:26 +0000137 set tail [file tail $testfile]
dan430e74c2010-06-07 17:47:26 +0000138
danielk19775f096132008-03-28 15:44:09 +0000139 if {[info exists STARTAT] && [string match $STARTAT $tail]} {unset STARTAT}
140 if {[info exists STARTAT]} continue
dan430e74c2010-06-07 17:47:26 +0000141
142 set run [expr {[llength $INCLUDE]==0}]
143 if {[info exists ISVERYQUICK] && [string match *malloc* $tail]} { set run 0 }
144 if {[info exists ISVERYQUICK] && [string match *ioerr* $tail]} { set run 0 }
145 if {[lsearch -exact $EXCLUDE $tail]>=0} { set run 0 }
146 if {[lsearch -exact $INCLUDE $tail]>=0} { set run 1 }
147 if {[lsearch -exact $QUICKTEST_INCLUDE $tail]>=0} { set run 1 }
148
149 if {$run} {
150 slave_test_file $testfile
drh5ea2df92007-04-16 17:07:55 +0000151 }
drhb19a2bc2001-09-16 00:13:26 +0000152}
dan430e74c2010-06-07 17:47:26 +0000153slave_test_file $testdir/misuse.test
drhb19a2bc2001-09-16 00:13:26 +0000154
dan430e74c2010-06-07 17:47:26 +0000155finish_test
156