From e36d23a85ebff914d74bb541558c2b6082b78edb Mon Sep 17 00:00:00 2001 From: dan miller Date: Sat, 20 Oct 2007 02:49:29 +0000 Subject: sqlite source (unix build) added to libraries --- libraries/sqlite/unix/sqlite-3.5.1/test/async.test | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 libraries/sqlite/unix/sqlite-3.5.1/test/async.test (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/async.test') 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 @@ +# +# 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. +# +# $Id: async.test,v 1.12 2007/09/14 16:20:01 danielk1977 Exp $ + + +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 +proc finish_test {} { + catch {db close} + catch {db2 close} + catch {db3 close} +} +set ISQUICK 1 + +set INCLUDE { + insert.test + insert2.test + insert3.test + lock.test + lock2.test + lock3.test + select1.test + select2.test + select3.test + select4.test + trans.test +} + +# 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 + sqlite3async_halt idle + sqlite3async_wait +} + +foreach testfile [lsort -dictionary [glob $testdir/*.test]] { + set tail [file tail $testfile] + if {[lsearch -exact $INCLUDE $tail]<0} continue + source $testfile + + # 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 +} + +# Flush the write-queue and disable asynchronous IO. This should ensure +# all allocated memory is cleaned up. +set sqlite3async_trace 1 +sqlite3async_halt idle +sqlite3async_start +sqlite3async_wait +sqlite3async_enable 0 +set sqlite3async_trace 0 + +really_finish_test +rename really_do_test do_test +rename really_finish_test finish_test -- cgit v1.1