xref: /sqlite-3.40.0/test/quick.test (revision 80a1526a)
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.95 2009/03/16 14:48:19 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  backup_ioerr.test
50  corrupt.test
51  corruptC.test
52  crash.test
53  crash2.test
54  crash3.test
55  crash4.test
56  crash5.test
57  crash6.test
58  crash7.test
59  delete3.test
60  e_fts3.test
61  fts3.test
62  fts3rnd.test
63  fkey_malloc.test
64  fuzz.test
65  fuzz3.test
66  fuzz_malloc.test
67  in2.test
68  loadext.test
69  memleak.test
70  misc7.test
71  misuse.test
72  mutex2.test
73  notify2.test
74  onefile.test
75  permutations.test
76  quick.test
77  savepoint4.test
78  savepoint6.test
79  select9.test
80  soak.test
81  speed1.test
82  speed1p.test
83  speed2.test
84  speed3.test
85  speed4.test
86  speed4p.test
87  sqllimits1.test
88  tkt2686.test
89  thread001.test
90  thread002.test
91  thread003.test
92  thread004.test
93  thread005.test
94  trans2.test
95  vacuum3.test
96
97  incrvacuum_ioerr.test
98  autovacuum_crash.test
99  btree8.test
100  shared_err.test
101  vtab_err.test
102  veryquick.test
103  mallocAll.test
104
105  walslow.test
106  walcrash.test
107  walthread.test
108}
109
110if {[sqlite3 -has-codec]} {
111  # lappend EXCLUDE \
112  #  conflict.test
113}
114
115
116# Files to include in the test.  If this list is empty then everything
117# that is not in the EXCLUDE list is run.
118#
119set INCLUDE {
120}
121
122# If the QUICKTEST_INCLUDE environment variable is set, then interpret
123# it as a list of test files. Always run these files, even if they
124# begin with "malloc*" or "ioerr*" or are part of the EXCLUDE list
125# defined above.
126#
127set QUICKTEST_INCLUDE {}
128catch { set QUICKTEST_INCLUDE $env(QUICKTEST_INCLUDE) }
129
130foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
131  set tail [file tail $testfile]
132  if { [lsearch $QUICKTEST_INCLUDE $tail]<0 } {
133    # If this is "veryquick.test", do not run any of the malloc or
134    # IO error simulations.
135    if {[info exists ISVERYQUICK] && (
136      [string match *malloc* $testfile] || [string match *ioerr* $testfile]
137    ) } {
138      continue
139    }
140    if {[lsearch -exact $EXCLUDE $tail]>=0} continue
141  }
142  if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
143  if {[info exists STARTAT] && [string match $STARTAT $tail]} {unset STARTAT}
144  if {[info exists STARTAT]} continue
145  source $testfile
146  catch {db close}
147  if {$sqlite_open_file_count>0} {
148    puts "$tail did not close all files: $sqlite_open_file_count"
149    incr nErr
150    lappend ::failList $tail
151    set sqlite_open_file_count 0
152  }
153}
154#set argv quick
155#source $testdir/permutations.test
156#set argv ""
157source $testdir/misuse.test
158
159set sqlite_open_file_count 0
160really_finish_test
161