blob: 2a723be975eb73715457babbfb7c970998ba8263 [file] [log] [blame]
drh23669402006-01-09 17:29:52 +00001#
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#
drh05a82982006-03-19 13:00:25 +00009# $Id: async.test,v 1.7 2006/03/19 13:00:25 drh Exp $
drh23669402006-01-09 17:29:52 +000010
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
drh97bbdc02006-02-13 18:35:06 +000032 trans.test
drh23669402006-01-09 17:29:52 +000033}
danielk1977750b03e2006-02-14 10:48:39 +000034# set INCLUDE {select4.test}
drh23669402006-01-09 17:29:52 +000035
36# Enable asynchronous IO.
37sqlite3async_enable 1
drh23669402006-01-09 17:29:52 +000038
39rename do_test really_do_test
40proc do_test {name args} {
41 uplevel really_do_test async_io-$name $args
42 sqlite3async_halt idle
drh23669402006-01-09 17:29:52 +000043 sqlite3async_start
drh97bbdc02006-02-13 18:35:06 +000044 sqlite3async_wait
drh23669402006-01-09 17:29:52 +000045}
46
47foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
48 set tail [file tail $testfile]
49 if {[lsearch -exact $INCLUDE $tail]<0} continue
50 source $testfile
51 catch {db close}
52}
53
danielk1977750b03e2006-02-14 10:48:39 +000054# Flush the write-queue and disable asynchronous IO. This should ensure
55# all allocated memory is cleaned up.
drh05a82982006-03-19 13:00:25 +000056set sqlite3async_trace 1
danielk1977750b03e2006-02-14 10:48:39 +000057sqlite3async_halt idle
58sqlite3async_start
drh23669402006-01-09 17:29:52 +000059sqlite3async_wait
60sqlite3async_enable 0
drh05a82982006-03-19 13:00:25 +000061set sqlite3async_trace 0
danielk1977750b03e2006-02-14 10:48:39 +000062
63really_finish_test
drh23669402006-01-09 17:29:52 +000064rename really_do_test do_test
65rename really_finish_test finish_test