os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/fts3.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/fts3.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,68 @@
     1.4 +# 2007 November 23
     1.5 +#
     1.6 +#    May you do good and not evil.
     1.7 +#    May you find forgiveness for yourself and forgive others.
     1.8 +#    May you share freely, never taking more than you give.
     1.9 +#
    1.10 +#***********************************************************************
    1.11 +# This file runs all tests.
    1.12 +#
    1.13 +# $Id: fts3.test,v 1.2 2008/07/23 18:17:32 drh Exp $
    1.14 +
    1.15 +proc lshift {lvar} {
    1.16 +  upvar $lvar l
    1.17 +  set ret [lindex $l 0]
    1.18 +  set l [lrange $l 1 end]
    1.19 +  return $ret
    1.20 +}
    1.21 +while {[set arg [lshift argv]] != ""} {
    1.22 +  switch -- $arg {
    1.23 +    -sharedpagercache {
    1.24 +      sqlite3_enable_shared_cache 1
    1.25 +    }
    1.26 +    -soak {
    1.27 +       set SOAKTEST 1
    1.28 +    }
    1.29 +    default {
    1.30 +      set argv [linsert $argv 0 $arg]
    1.31 +      break
    1.32 +    }
    1.33 +  }
    1.34 +}
    1.35 +
    1.36 +set testdir [file dirname $argv0]
    1.37 +source $testdir/tester.tcl
    1.38 +# If SQLITE_ENABLE_FTS3 is defined, omit this file.
    1.39 +ifcapable !fts3 {
    1.40 +  return
    1.41 +}
    1.42 +rename finish_test really_finish_test
    1.43 +proc finish_test {} {}
    1.44 +set ISQUICK 1
    1.45 +
    1.46 +set EXCLUDE {
    1.47 +  fts3.test
    1.48 +}
    1.49 +
    1.50 +# Files to include in the test.  If this list is empty then everything
    1.51 +# that is not in the EXCLUDE list is run.
    1.52 +#
    1.53 +set INCLUDE {
    1.54 +}
    1.55 +
    1.56 +foreach testfile [lsort -dictionary [glob $testdir/fts3*.test]] {
    1.57 +  set tail [file tail $testfile]
    1.58 +  if {[lsearch -exact $EXCLUDE $tail]>=0} continue
    1.59 +  if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
    1.60 +  source $testfile
    1.61 +  catch {db close}
    1.62 +  if {$sqlite_open_file_count>0} {
    1.63 +    puts "$tail did not close all files: $sqlite_open_file_count"
    1.64 +    incr nErr
    1.65 +    lappend ::failList $tail
    1.66 +    set sqlite_open_file_count 0
    1.67 +  }
    1.68 +}
    1.69 +
    1.70 +set sqlite_open_file_count 0
    1.71 +really_finish_test