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.9 2007/09/04 18:28:44 danielk1977 Exp $ 10 11 12if {[catch {sqlite3async_enable}]} { 13 # The async logic is not built into this system 14 return 15} 16 17 18set testdir [file dirname $argv0] 19source $testdir/tester.tcl 20rename finish_test really_finish_test 21proc finish_test {} {} 22set ISQUICK 1 23 24set INCLUDE { 25 select1.test 26 select2.test 27 select3.test 28 select4.test 29 insert.test 30 insert2.test 31 insert3.test 32 trans.test 33 lock.test 34 lock3.test 35 lock2.test 36} 37# set INCLUDE lock4.test 38 39# Enable asynchronous IO. 40sqlite3async_enable 1 41 42rename do_test really_do_test 43proc do_test {name args} { 44 uplevel really_do_test async_io-$name $args 45 sqlite3async_halt idle 46 sqlite3async_start 47 sqlite3async_wait 48} 49 50foreach testfile [lsort -dictionary [glob $testdir/*.test]] { 51 set tail [file tail $testfile] 52 if {[lsearch -exact $INCLUDE $tail]<0} continue 53 source $testfile 54 catch {db close} 55} 56 57# Flush the write-queue and disable asynchronous IO. This should ensure 58# all allocated memory is cleaned up. 59set sqlite3async_trace 1 60sqlite3async_halt idle 61sqlite3async_start 62sqlite3async_wait 63sqlite3async_enable 0 64set sqlite3async_trace 0 65 66really_finish_test 67rename really_do_test do_test 68rename really_finish_test finish_test 69