AryaWu/sqlite
0
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 out-of-memory tests.8#9# $Id: mallocAll.test,v 1.1 2007/11/26 13:36:00 drh Exp $10 11proc lshift {lvar} {12 upvar $lvar l13 set ret [lindex $l 0]14 set l [lrange $l 1 end]15 return $ret16}17while {[set arg [lshift argv]] != ""} {18 switch -- $arg {19 -sharedpagercache {20 sqlite3_enable_shared_cache 121 }22 default {23 set argv [linsert $argv 0 $arg]24 break25 }26 }27}28 29set testdir [file dirname $argv0]30source $testdir/tester.tcl31rename finish_test really_finish_test32proc finish_test {} {}33set G(isquick) 134 35set EXCLUDE {36 mallocAll.test37}38 39if {[sqlite3 -has-codec]} {40 # lappend EXCLUDE \41 # conflict.test42}43 44 45# Files to include in the test. If this list is empty then everything46# that is not in the EXCLUDE list is run.47#48set INCLUDE {49}50 51foreach testfile [lsort -dictionary [glob $testdir/*malloc*.test]] {52 set tail [file tail $testfile]53 if {[lsearch -exact $EXCLUDE $tail]>=0} continue54 if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue55 source $testfile56 catch {db close}57 if {$sqlite_open_file_count>0} {58 puts "$tail did not close all files: $sqlite_open_file_count"59 fail_test $tail60 set sqlite_open_file_count 061 }62}63source $testdir/misuse.test64 65set sqlite_open_file_count 066really_finish_test67 