4 # The author disclaims copyright to this source code. In place of
5 # a legal notice, here is a blessing:
7 # May you do good and not evil.
8 # May you find forgiveness for yourself and forgive others.
9 # May you share freely, never taking more than you give.
11 #***********************************************************************
12 # This file runs all tests.
14 # $Id: memleak.test,v 1.3 2004/02/12 18:46:39 drh Exp $
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 rename finish_test really_finish_test
24 if {[file exists ./sqlite_test_count]} {
25 set COUNT [exec cat ./sqlite_test_count]
30 # LeakList will hold a list of the number of unfreed mallocs after
31 # each round of the test. This number should be constant. If it
32 # grows, it may mean there is a memory leak in the library.
45 if {[sqlite -has-codec]} {
53 if {[llength $argv]>0} {
57 set FILELIST [lsort -dictionary [glob $testdir/*.test]]
60 foreach testfile $FILELIST {
61 set tail [file tail $testfile]
62 if {[lsearch -exact $EXCLUDE $tail]>=0} continue
64 for {set COUNTER 0} {$COUNTER<$COUNT} {incr COUNTER} {
66 if {[info exists Leak]} {
67 lappend LeakList $Leak
71 puts -nonewline memory-leak-test-$tail...
74 if {$x!=[lindex $LeakList 0]} {
75 puts " failed! ($LeakList)"
77 lappend ::failList memory-leak-test-$tail
86 # Run the malloc tests and the misuse test after memory leak detection.
87 # Both tests leak memory.
89 #catch {source $testdir/misuse.test}
90 #catch {source $testdir/malloc.test}