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 | # |
danielk1977 | 750b03e | 2006-02-14 10:48:39 +0000 | [diff] [blame^] | 9 | # $Id: async.test,v 1.6 2006/02/14 10:48:40 danielk1977 Exp $ |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 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 |
drh | 97bbdc0 | 2006-02-13 18:35:06 +0000 | [diff] [blame] | 32 | trans.test |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 33 | } |
danielk1977 | 750b03e | 2006-02-14 10:48:39 +0000 | [diff] [blame^] | 34 | # set INCLUDE {select4.test} |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 35 | |
| 36 | # Enable asynchronous IO. |
| 37 | sqlite3async_enable 1 |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 38 | |
| 39 | rename do_test really_do_test |
| 40 | proc do_test {name args} { |
| 41 | uplevel really_do_test async_io-$name $args |
| 42 | sqlite3async_halt idle |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 43 | sqlite3async_start |
drh | 97bbdc0 | 2006-02-13 18:35:06 +0000 | [diff] [blame] | 44 | sqlite3async_wait |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | foreach 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 | |
danielk1977 | 750b03e | 2006-02-14 10:48:39 +0000 | [diff] [blame^] | 54 | # Flush the write-queue and disable asynchronous IO. This should ensure |
| 55 | # all allocated memory is cleaned up. |
| 56 | sqlite3async_halt idle |
| 57 | sqlite3async_start |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 58 | sqlite3async_wait |
| 59 | sqlite3async_enable 0 |
danielk1977 | 750b03e | 2006-02-14 10:48:39 +0000 | [diff] [blame^] | 60 | |
| 61 | really_finish_test |
drh | 2366940 | 2006-01-09 17:29:52 +0000 | [diff] [blame] | 62 | rename really_do_test do_test |
| 63 | rename really_finish_test finish_test |