drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame^] | 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.3 2006/01/09 17:29:53 drh Exp $ |
| 10 | |
| 11 | |
| 12 | if {[catch {sqlite3async_enable}]} { |
| 13 | # The async logic is not built into this system |
| 14 | return |
| 15 | } |
| 16 | |
| 17 | |
| 18 | set testdir [file dirname $argv0] |
| 19 | source $testdir/tester.tcl |
| 20 | rename finish_test really_finish_test |
| 21 | proc finish_test {} {} |
| 22 | set ISQUICK 1 |
| 23 | |
| 24 | set INCLUDE { |
| 25 | select1.test |
| 26 | select2.test |
| 27 | select3.test |
| 28 | select4.test |
| 29 | insert.test |
| 30 | insert2.test |
| 31 | insert3.test |
| 32 | } |
| 33 | #set INCLUDE [lrange $INCLUDE 0 0] |
| 34 | |
| 35 | # Enable asynchronous IO. |
| 36 | sqlite3async_enable 1 |
| 37 | sqlite3async_halt never |
| 38 | sqlite3async_start |
| 39 | |
| 40 | rename do_test really_do_test |
| 41 | proc do_test {name args} { |
| 42 | uplevel really_do_test async_io-$name $args |
| 43 | sqlite3async_halt idle |
| 44 | sqlite3async_wait |
| 45 | sqlite3async_halt never |
| 46 | sqlite3async_start |
| 47 | } |
| 48 | |
| 49 | foreach testfile [lsort -dictionary [glob $testdir/*.test]] { |
| 50 | set tail [file tail $testfile] |
| 51 | if {[lsearch -exact $INCLUDE $tail]<0} continue |
| 52 | source $testfile |
| 53 | catch {db close} |
| 54 | } |
| 55 | |
| 56 | |
| 57 | set sqlite_open_file_count 0 |
| 58 | really_finish_test |
| 59 | sqlite3async_halt now |
| 60 | sqlite3async_wait |
| 61 | sqlite3async_enable 0 |
| 62 | rename really_do_test do_test |
| 63 | rename really_finish_test finish_test |