1# 2001 September 15 2# 3# The author disclaims copyright to this source code. In place of 4# a legal notice, here is a blessing: 5# 6# May you do good and not evil. 7# May you find forgiveness for yourself and forgive others. 8# May you share freely, never taking more than you give. 9# 10#*********************************************************************** 11# This file runs all tests. 12# 13# $Id: all.test,v 1.62 2009/01/06 18:43:51 drh Exp $ 14 15set testdir [file dirname $argv0] 16source $testdir/tester.tcl 17db close 18 19if {[file exists ./sqlite_test_count]} { 20 set COUNT [exec cat ./sqlite_test_count] 21} else { 22 set COUNT 1 23} 24 25if {[llength $argv]>0} { 26 foreach {name value} $argv { 27 switch -- $name { 28 -count { 29 set COUNT $value 30 } 31 -quick { 32 set G(isquick) $value 33 } 34 -soak { 35 set G(issoak) $value 36 } 37 default { 38 puts stderr "Unknown option: $name" 39 exit 40 } 41 } 42 } 43} 44set argv {} 45 46set EXCLUDE {} 47lappend EXCLUDE all.test ;# This file 48lappend EXCLUDE async.test 49lappend EXCLUDE crash.test ;# Run separately later. 50lappend EXCLUDE crash2.test ;# Run separately later. 51lappend EXCLUDE quick.test ;# Alternate test driver script 52lappend EXCLUDE veryquick.test ;# Alternate test driver script 53lappend EXCLUDE misuse.test ;# Run separately later. 54lappend EXCLUDE memleak.test ;# Alternate test driver script 55lappend EXCLUDE permutations.test ;# Run separately later. 56lappend EXCLUDE soak.test ;# Takes a very long time (default 1 hr) 57lappend EXCLUDE fts3.test ;# Wrapper for muliple fts3*.tests 58lappend EXCLUDE mallocAll.test ;# Wrapper for running all malloc tests 59 60# Files to include in the test. If this list is empty then everything 61# that is not in the EXCLUDE list is run. 62# 63set INCLUDE { 64} 65 66for {set Counter 0} {$Counter<$COUNT} {incr Counter} { 67 foreach testfile [lsort -dictionary [glob $testdir/*.test]] { 68 set tail [file tail $testfile] 69 if {[lsearch -exact $EXCLUDE $tail]>=0} continue 70 if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue 71 reset_prng_state 72 slave_test_file $testfile 73 } 74 75 if {[set_test_counter errors]} break 76} 77set argv all 78source $testdir/permutations.test 79set argv "" 80 81# Run the crashtest only on unix and only once. If the library does not 82# always create auto-vacuum databases, also run autovacuum_crash.test. 83# 84if {$::tcl_platform(platform)=="unix"} { 85 slave_test_file [file join $testdir crash.test] 86 slave_test_file [file join $testdir crash2.test] 87 88 ifcapable !default_autovacuum { 89 set argv autovacuum_crash 90 source $testdir/permutations.test 91 set argv "" 92 } 93} 94 95# Run the misuse test after memory leak detection. It may leak memory. 96# Currently, misuse.test also leaks a handful of file descriptors. This is 97# not considered a problem. 98# 99slave_test_file [file join $testdir misuse.test] 100finish_test 101 102