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