aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/async.test
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/async.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/async.test78
1 files changed, 78 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/async.test b/libraries/sqlite/unix/sqlite-3.5.1/test/async.test
new file mode 100644
index 0000000..268a7ca
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/async.test
@@ -0,0 +1,78 @@
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.12 2007/09/14 16:20:01 danielk1977 Exp $
10
11
12if {[catch {sqlite3async_enable}]} {
13 # The async logic is not built into this system
14 return
15}
16
17set testdir [file dirname $argv0]
18source $testdir/tester.tcl
19rename finish_test really_finish_test
20proc finish_test {} {
21 catch {db close}
22 catch {db2 close}
23 catch {db3 close}
24}
25set ISQUICK 1
26
27set INCLUDE {
28 insert.test
29 insert2.test
30 insert3.test
31 lock.test
32 lock2.test
33 lock3.test
34 select1.test
35 select2.test
36 select3.test
37 select4.test
38 trans.test
39}
40
41# Enable asynchronous IO.
42sqlite3async_enable 1
43
44rename do_test really_do_test
45proc do_test {name args} {
46 uplevel really_do_test async_io-$name $args
47 sqlite3async_start
48 sqlite3async_halt idle
49 sqlite3async_wait
50}
51
52foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
53 set tail [file tail $testfile]
54 if {[lsearch -exact $INCLUDE $tail]<0} continue
55 source $testfile
56
57 # Make sure everything is flushed through. This is because [source]ing
58 # the next test file will delete the database file on disk (using
59 # [file delete]). If the asynchronous backend still has the file
60 # open, it will become confused.
61 #
62 sqlite3async_halt idle
63 sqlite3async_start
64 sqlite3async_wait
65}
66
67# Flush the write-queue and disable asynchronous IO. This should ensure
68# all allocated memory is cleaned up.
69set sqlite3async_trace 1
70sqlite3async_halt idle
71sqlite3async_start
72sqlite3async_wait
73sqlite3async_enable 0
74set sqlite3async_trace 0
75
76really_finish_test
77rename really_do_test do_test
78rename really_finish_test finish_test