1# 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# 9# $Id: quick.test,v 1.91 2009/01/03 10:41:29 danielk1977 Exp $ 10 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 } 22 -soak { 23 set SOAKTEST 1 24 } 25 -start { 26 set STARTAT "[lshift argv]*" 27 } 28 default { 29 set argv [linsert $argv 0 $arg] 30 break 31 } 32 } 33} 34 35set testdir [file dirname $argv0] 36source $testdir/tester.tcl 37rename finish_test really_finish_test 38proc finish_test {} { 39 catch {db close} 40 show_memstats 41} 42set ISQUICK 1 43 44set EXCLUDE { 45 all.test 46 async.test 47 async2.test 48 async3.test 49 corrupt.test 50 corruptC.test 51 crash.test 52 crash2.test 53 crash3.test 54 crash4.test 55 crash5.test 56 crash6.test 57 crash7.test 58 delete3.test 59 fts3.test 60 fuzz.test 61 fuzz3.test 62 fuzz_malloc.test 63 in2.test 64 loadext.test 65 memleak.test 66 misc7.test 67 misuse.test 68 mutex2.test 69 onefile.test 70 permutations.test 71 quick.test 72 savepoint4.test 73 savepoint6.test 74 select9.test 75 soak.test 76 speed1.test 77 speed1p.test 78 speed2.test 79 speed3.test 80 speed4.test 81 speed4p.test 82 sqllimits1.test 83 tkt2686.test 84 thread001.test 85 thread002.test 86 thread003.test 87 trans2.test 88 vacuum3.test 89 90 incrvacuum_ioerr.test 91 autovacuum_crash.test 92 btree8.test 93 shared_err.test 94 vtab_err.test 95 veryquick.test 96 mallocAll.test 97} 98 99if {[sqlite3 -has-codec]} { 100 # lappend EXCLUDE \ 101 # conflict.test 102} 103 104 105# Files to include in the test. If this list is empty then everything 106# that is not in the EXCLUDE list is run. 107# 108set INCLUDE { 109} 110 111foreach testfile [lsort -dictionary [glob $testdir/*.test]] { 112 # If this is "veryquick.test", do not run any of the malloc or 113 # IO error simulations. 114 if {[info exists ISVERYQUICK] && ( 115 [string match *malloc* $testfile] || [string match *ioerr* $testfile] 116 ) } { 117 continue 118 } 119 120 set tail [file tail $testfile] 121 if {[lsearch -exact $EXCLUDE $tail]>=0} continue 122 if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue 123 if {[info exists STARTAT] && [string match $STARTAT $tail]} {unset STARTAT} 124 if {[info exists STARTAT]} continue 125 source $testfile 126 catch {db close} 127 if {$sqlite_open_file_count>0} { 128 puts "$tail did not close all files: $sqlite_open_file_count" 129 incr nErr 130 lappend ::failList $tail 131 set sqlite_open_file_count 0 132 } 133} 134#set argv quick 135#source $testdir/permutations.test 136#set argv "" 137source $testdir/misuse.test 138 139set sqlite_open_file_count 0 140really_finish_test 141