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 tests. 8# 9# $Id: async.test,v 1.1 2006/01/03 13:39:26 danielk1977 Exp $ 10 11set testdir [file dirname $argv0] 12source $testdir/tester.tcl 13rename finish_test really_finish_test 14proc finish_test {} {} 15set ISQUICK 1 16 17if {[info exists ::tcl_platform(threaded)]} { 18 set USE_THREAD 1 19} else { 20 set USE_THREAD 0 21} 22 23set INCLUDE { 24 select1.test 25 select2.test 26 select3.test 27 select4.test 28 insert.test 29 insert2.test 30 insert3.test 31} 32#set INCLUDE [lrange $INCLUDE 0 0] 33 34# Enable asynchronous IO. 35sqlite3_async_enable 36 37# set USE_THREAD 0 38if {$USE_THREAD} { 39 sqlite3_async_flush -start 40} else { 41 rename do_test really_do_test 42 proc do_test {name args} { 43 uplevel really_do_test async_io-$name $args 44 sqlite3_async_flush 45 } 46} 47 48foreach testfile [lsort -dictionary [glob $testdir/*.test]] { 49 set tail [file tail $testfile] 50 if {[lsearch -exact $INCLUDE $tail]<0} continue 51 source $testfile 52 catch {db close} 53# if {$sqlite_open_file_count>0} { 54# puts "$tail did not close all files: $sqlite_open_file_count" 55# incr nErr 56# lappend ::failList $tail 57# } 58} 59#source $testdir/misuse.test 60 61 62if {$USE_THREAD} { 63 sqlite3_async_flush -stop 64} else { 65 rename do_test {} 66 rename really_do_test do_test 67 puts "Warning: Tcl library was without --enable-threads." 68 puts " Cannot test async IO properly." 69 sqlite3_async_flush 70} 71 72set sqlite_open_file_count 0 73really_finish_test 74 75