blob: b1e2959366cb3a66992622ce96a30989c1807ebb [file] [log] [blame]
drh4dc754d2008-07-23 18:17:32 +00001# 2008 July 22
shessb2822a22008-07-22 22:57:54 +00002#
3# May you do good and not evil.
4# May you find forgiveness for yourself and forgive others.
5# May you share freely, never taking more than you give.
6#
7#***********************************************************************
8# This file runs all tests.
9#
drh4dc754d2008-07-23 18:17:32 +000010# $Id: fts2.test,v 1.2 2008/07/23 18:17:32 drh Exp $
shessb2822a22008-07-22 22:57:54 +000011
12proc lshift {lvar} {
13 upvar $lvar l
14 set ret [lindex $l 0]
15 set l [lrange $l 1 end]
16 return $ret
17}
18while {[set arg [lshift argv]] != ""} {
19 switch -- $arg {
20 -sharedpagercache {
21 sqlite3_enable_shared_cache 1
22 }
23 -soak {
dan430e74c2010-06-07 17:47:26 +000024 set G(issoak) 1
shessb2822a22008-07-22 22:57:54 +000025 }
26 default {
27 set argv [linsert $argv 0 $arg]
28 break
29 }
30 }
31}
32
33set testdir [file dirname $argv0]
34source $testdir/tester.tcl
35# If SQLITE_ENABLE_FTS2 is defined, omit this file.
36ifcapable !fts2 {
drh4dc754d2008-07-23 18:17:32 +000037 return
shessb2822a22008-07-22 22:57:54 +000038}
39rename finish_test really_finish_test
40proc finish_test {} {}
dan430e74c2010-06-07 17:47:26 +000041set G(isquick) 1
shessb2822a22008-07-22 22:57:54 +000042
43set EXCLUDE {
44 fts2.test
45}
46
47# Files to include in the test. If this list is empty then everything
48# that is not in the EXCLUDE list is run.
49#
50set INCLUDE {
51}
52
53foreach testfile [lsort -dictionary [glob $testdir/fts2*.test]] {
54 set tail [file tail $testfile]
55 if {[lsearch -exact $EXCLUDE $tail]>=0} continue
56 if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
57 source $testfile
58 catch {db close}
59 if {$sqlite_open_file_count>0} {
60 puts "$tail did not close all files: $sqlite_open_file_count"
danc1a60c52010-06-07 14:28:16 +000061 fail_test $tail
shessb2822a22008-07-22 22:57:54 +000062 set sqlite_open_file_count 0
63 }
64}
65
66set sqlite_open_file_count 0
67really_finish_test