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