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