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