2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A# The author disclaims copyright to this source code. In place of
2N/A# a legal notice, here is a blessing:
2N/A# May you do good and not evil.
2N/A# May you find forgiveness for yourself and forgive others.
2N/A# May you share freely, never taking more than you give.
2N/A#***********************************************************************
2N/A# This file runs all tests.
2N/Aset testdir [file dirname $argv0]
2N/Arename finish_test really_finish_test
2N/Aproc finish_test {} {
2N/Aif {[file exists ./sqlite_test_count]} {
2N/A set COUNT [exec cat ./sqlite_test_count]
2N/A# LeakList will hold a list of the number of unfreed mallocs after
2N/A# each round of the test. This number should be constant. If it
2N/A# grows, it may mean there is a memory leak in the library.
2N/Aif {[sqlite -has-codec]} {
2N/Aif {[llength $argv]>0} {
2N/A set FILELIST [lsort -dictionary [glob $testdir/*.test]]
2N/Aforeach testfile $FILELIST {
2N/A set tail [file tail $testfile]
2N/A if {[lsearch -exact $EXCLUDE $tail]>=0} continue
2N/A for {set COUNTER 0} {$COUNTER<$COUNT} {incr COUNTER} {
2N/A if {[info exists Leak]} {
2N/A lappend LeakList $Leak
2N/A if {$LeakList!=""} {
2N/A puts -nonewline memory-leak-test-$tail...
2N/A foreach x $LeakList {
2N/A if {$x!=[lindex $LeakList 0]} {
2N/A puts " failed! ($LeakList)"
2N/A lappend ::failList memory-leak-test-$tail
2N/A# Run the malloc tests and the misuse test after memory leak detection.
2N/A# Both tests leak memory.