2006-01-09 20:29:52 +03:00
|
|
|
#
|
|
|
|
# May you do good and not evil.
|
|
|
|
# May you find forgiveness for yourself and forgive others.
|
|
|
|
# May you share freely, never taking more than you give.
|
|
|
|
#
|
|
|
|
#***********************************************************************
|
|
|
|
# This file runs all tests.
|
|
|
|
#
|
2007-11-05 20:01:08 +03:00
|
|
|
# $Id: async.test,v 1.13 2007/11/05 17:01:08 danielk1977 Exp $
|
2006-01-09 20:29:52 +03:00
|
|
|
|
|
|
|
|
|
|
|
if {[catch {sqlite3async_enable}]} {
|
|
|
|
# The async logic is not built into this system
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
set testdir [file dirname $argv0]
|
|
|
|
source $testdir/tester.tcl
|
|
|
|
rename finish_test really_finish_test
|
2007-09-05 15:34:54 +04:00
|
|
|
proc finish_test {} {
|
|
|
|
catch {db close}
|
|
|
|
catch {db2 close}
|
|
|
|
catch {db3 close}
|
|
|
|
}
|
2006-01-09 20:29:52 +03:00
|
|
|
set ISQUICK 1
|
|
|
|
|
|
|
|
set INCLUDE {
|
|
|
|
insert.test
|
|
|
|
insert2.test
|
|
|
|
insert3.test
|
2007-09-04 18:31:47 +04:00
|
|
|
lock.test
|
2007-09-04 22:28:43 +04:00
|
|
|
lock2.test
|
2007-09-05 17:56:32 +04:00
|
|
|
lock3.test
|
|
|
|
select1.test
|
|
|
|
select2.test
|
|
|
|
select3.test
|
|
|
|
select4.test
|
|
|
|
trans.test
|
2006-01-09 20:29:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
# Enable asynchronous IO.
|
|
|
|
sqlite3async_enable 1
|
|
|
|
|
|
|
|
rename do_test really_do_test
|
|
|
|
proc do_test {name args} {
|
|
|
|
uplevel really_do_test async_io-$name $args
|
|
|
|
sqlite3async_start
|
2007-09-05 17:56:32 +04:00
|
|
|
sqlite3async_halt idle
|
2006-02-13 21:35:06 +03:00
|
|
|
sqlite3async_wait
|
2007-11-05 20:01:08 +03:00
|
|
|
sqlite3async_halt never
|
2006-01-09 20:29:52 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
|
|
|
|
set tail [file tail $testfile]
|
|
|
|
if {[lsearch -exact $INCLUDE $tail]<0} continue
|
|
|
|
source $testfile
|
2007-09-05 15:34:54 +04:00
|
|
|
|
|
|
|
# Make sure everything is flushed through. This is because [source]ing
|
|
|
|
# the next test file will delete the database file on disk (using
|
|
|
|
# [file delete]). If the asynchronous backend still has the file
|
|
|
|
# open, it will become confused.
|
|
|
|
#
|
|
|
|
sqlite3async_halt idle
|
|
|
|
sqlite3async_start
|
|
|
|
sqlite3async_wait
|
2007-11-05 20:01:08 +03:00
|
|
|
sqlite3async_halt never
|
2006-01-09 20:29:52 +03:00
|
|
|
}
|
|
|
|
|
2006-02-14 13:48:39 +03:00
|
|
|
# Flush the write-queue and disable asynchronous IO. This should ensure
|
|
|
|
# all allocated memory is cleaned up.
|
2006-03-19 16:00:25 +03:00
|
|
|
set sqlite3async_trace 1
|
2006-02-14 13:48:39 +03:00
|
|
|
sqlite3async_halt idle
|
|
|
|
sqlite3async_start
|
2006-01-09 20:29:52 +03:00
|
|
|
sqlite3async_wait
|
2007-11-05 20:01:08 +03:00
|
|
|
sqlite3async_halt never
|
2006-01-09 20:29:52 +03:00
|
|
|
sqlite3async_enable 0
|
2006-03-19 16:00:25 +03:00
|
|
|
set sqlite3async_trace 0
|
2006-02-14 13:48:39 +03:00
|
|
|
|
|
|
|
really_finish_test
|
2006-01-09 20:29:52 +03:00
|
|
|
rename really_do_test do_test
|
|
|
|
rename really_finish_test finish_test
|