3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file is the driver for the "soak" tests. It is a peer of the
12 # quick.test and all.test scripts.
14 # $Id: soak.test,v 1.4 2008/11/13 18:29:51 shane Exp $
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 rename finish_test really_finish_test
19 proc finish_test {} {}
21 # By default, guarantee that the tests will run for at least 1 hour.
25 # Process command-line arguments.
27 if {[llength $argv]>0} {
28 foreach {name value} $argv {
34 puts stderr "Unknown option: $name"
44 # The general principle is to run those SQLite tests that use
45 # pseudo-random data in some way over and over again for a very
46 # long time. The number of tests run depends on the value of
47 # global variable $TIMEOUT - tests are run for at least $TIMEOUT
50 # fuzz.test (pseudo-random SQL statements)
51 # trans.test (pseudo-random changes to a database followed by rollbacks)
53 # corruptC.test (pseudo-random corruption to a database)
55 # Many database changes maintaining some kind of invariant.
56 # Storing checksums etc.
59 # List of test files that are run by this file.
70 set soak_starttime [clock seconds]
71 set soak_finishtime [expr {$soak_starttime + $TIMEOUT}]
73 # Loop until the timeout is reached or an error occurs.
75 for {set iRun 0} {[clock seconds] < $soak_finishtime} {incr iRun} {
77 set iIdx [expr {$iRun % [llength $SOAKTESTS]}]
78 source [file join $testdir [lindex $SOAKTESTS $iIdx]]
81 if {$sqlite_open_file_count>0} {
82 puts "$tail did not close all files: $sqlite_open_file_count"
84 set sqlite_open_file_count 0
87 if {[set_test_counter errors]>0} break