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