xref: /sqlite-3.40.0/test/quick.test (revision 15542621)
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.88 2008/10/13 14:16:11 drh 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  crash.test
51  crash2.test
52  crash3.test
53  crash4.test
54  crash5.test
55  crash6.test
56  crash7.test
57  delete3.test
58  fts3.test
59  fuzz.test
60  fuzz3.test
61  fuzz_malloc.test
62  in2.test
63  loadext.test
64  memleak.test
65  misc7.test
66  misuse.test
67  mutex2.test
68  onefile.test
69  permutations.test
70  quick.test
71  select9.test
72  soak.test
73  speed1.test
74  speed1p.test
75  speed2.test
76  speed3.test
77  speed4.test
78  speed4p.test
79  sqllimits1.test
80  tkt2686.test
81  thread001.test
82  thread002.test
83  thread003.test
84  trans2.test
85  vacuum3.test
86
87  incrvacuum_ioerr.test
88  autovacuum_crash.test
89  btree8.test
90  shared_err.test
91  vtab_err.test
92  veryquick.test
93  mallocAll.test
94}
95
96if {[sqlite3 -has-codec]} {
97  # lappend EXCLUDE \
98  #  conflict.test
99}
100
101
102# Files to include in the test.  If this list is empty then everything
103# that is not in the EXCLUDE list is run.
104#
105set INCLUDE {
106}
107
108foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
109  # If this is "veryquick.test", do not run any of the malloc or
110  # IO error simulations.
111  if {[info exists ISVERYQUICK] && (
112    [string match *malloc* $testfile] || [string match *ioerr* $testfile]
113  ) } {
114    continue
115  }
116
117  set tail [file tail $testfile]
118  if {[lsearch -exact $EXCLUDE $tail]>=0} continue
119  if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
120  if {[info exists STARTAT] && [string match $STARTAT $tail]} {unset STARTAT}
121  if {[info exists STARTAT]} continue
122  source $testfile
123  catch {db close}
124  if {$sqlite_open_file_count>0} {
125    puts "$tail did not close all files: $sqlite_open_file_count"
126    incr nErr
127    lappend ::failList $tail
128    set sqlite_open_file_count 0
129  }
130}
131#set argv quick
132#source $testdir/permutations.test
133#set argv ""
134source $testdir/misuse.test
135
136set sqlite_open_file_count 0
137really_finish_test
138