xref: /sqlite-3.40.0/test/async.test (revision 7c836f06)
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.8 2007/09/04 14:31:47 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}
36
37# Enable asynchronous IO.
38sqlite3async_enable 1
39
40rename do_test really_do_test
41proc do_test {name args} {
42  uplevel really_do_test async_io-$name $args
43  sqlite3async_halt idle
44  sqlite3async_start
45  sqlite3async_wait
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}
54
55# Flush the write-queue and disable asynchronous IO. This should ensure
56# all allocated memory is cleaned up.
57set sqlite3async_trace 1
58sqlite3async_halt idle
59sqlite3async_start
60sqlite3async_wait
61sqlite3async_enable 0
62set sqlite3async_trace 0
63
64really_finish_test
65rename really_do_test do_test
66rename really_finish_test finish_test
67