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