Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Prevent the tcl test suite from throwing an exception when a threadsafe SQLite is linked against a non-threadsafe Tcl for testing. Print a warning instead. Ticket #3753. (CVS 6389) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
a22e7c818b2227a4c80ad84b299d11f3 |
User & Date: | danielk1977 2009-03-26 14:48:07.000 |
Context
2009-03-26
| ||
17:13 | Check that the first byte of a potentially hot journal file is non-zero before beginning hot-journal rollback. Fix for #3751 and #3745. (CVS 6390) (check-in: 80241a0502 user: danielk1977 tags: trunk) | |
14:48 | Prevent the tcl test suite from throwing an exception when a threadsafe SQLite is linked against a non-threadsafe Tcl for testing. Print a warning instead. Ticket #3753. (CVS 6389) (check-in: a22e7c818b user: danielk1977 tags: trunk) | |
12:20 | Added new tests of the scratch memory allocator for increased test coverage. (CVS 6388) (check-in: e99e28efbb user: drh tags: trunk) | |
Changes
Changes to test/notify2.test.
1 2 3 4 5 6 7 8 9 10 11 | # 2009 March 04 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 2009 March 04 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # $Id: notify2.test,v 1.5 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } # The tests in this file test the sqlite3_blocking_step() function in # test_thread.c. sqlite3_blocking_step() is not an SQLite API function, # it is just a demonstration of how the sqlite3_unlock_notify() function # can be used to synchronize multi-threaded access to SQLite databases # in shared-cache mode. # |
︙ | ︙ | |||
35 36 37 38 39 40 41 | # error is returned the current transaction is rolled back immediately. # # This exercise is repeated twice, once using sqlite3_step(), and the # other using sqlite3_blocking_step(). The results are compared to ensure # that sqlite3_blocking_step() resulted in higher transaction throughput. # | < < < < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # error is returned the current transaction is rolled back immediately. # # This exercise is repeated twice, once using sqlite3_step(), and the # other using sqlite3_blocking_step(). The results are compared to ensure # that sqlite3_blocking_step() resulted in higher transaction throughput. # db close set ::enable_shared_cache [sqlite3_enable_shared_cache 1] # Number of threads to run simultaneously. # set nThread 6 set nSecond 5 # The Tcl script executed by each of the $nThread threads used by this test. |
︙ | ︙ |
Changes to test/thread001.test.
1 2 3 4 5 6 7 8 9 10 11 | # 2007 September 7 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # | | < | < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 2007 September 7 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # $Id: thread001.test,v 1.10 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } set ::enable_shared_cache [sqlite3_enable_shared_cache] set ::NTHREAD 10 # Run this test three times: # |
︙ | ︙ |
Changes to test/thread002.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # May you share freely, never taking more than you give. # #*********************************************************************** # # This test attempts to deadlock SQLite in shared-cache mode. # # | | < < | < < < < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # May you share freely, never taking more than you give. # #*********************************************************************** # # This test attempts to deadlock SQLite in shared-cache mode. # # # $Id: thread002.test,v 1.9 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } db close set ::enable_shared_cache [sqlite3_enable_shared_cache 1] set ::NTHREAD 10 do_test thread002.1 { |
︙ | ︙ |
Changes to test/thread003.test.
︙ | ︙ | |||
8 9 10 11 12 13 14 | # May you share freely, never taking more than you give. # #*********************************************************************** # # This file contains tests that attempt to break the pcache module # by bombarding it with simultaneous requests from multiple threads. # | | < < | < < < < < < | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # May you share freely, never taking more than you give. # #*********************************************************************** # # This file contains tests that attempt to break the pcache module # by bombarding it with simultaneous requests from multiple threads. # # $Id: thread003.test,v 1.8 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } # Set up a couple of different databases full of pseudo-randomly # generated data. # do_test thread003.1.1 { execsql { BEGIN; |
︙ | ︙ |
Changes to test/thread004.test.
1 2 3 4 5 6 7 8 9 10 11 | # 2009 February 26 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # | | > | > < < | < > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # 2009 February 26 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # $Id: thread004.test,v 1.2 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } ifcapable !shared_cache { finish_test return } if { [info commands sqlite3_table_column_metadata] eq "" } { finish_test return } # Use shared-cache mode for this test. # db close set ::enable_shared_cache [sqlite3_enable_shared_cache] |
︙ | ︙ |
Changes to test/thread005.test.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 2009 March 11 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # Test a race-condition that shows up in shared-cache mode. # | | > | > < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # 2009 March 11 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # Test a race-condition that shows up in shared-cache mode. # # $Id: thread005.test,v 1.5 2009/03/26 14:48:07 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[run_thread_tests]==0} { finish_test ; return } ifcapable !shared_cache { finish_test return } db close # Use shared-cache mode for these tests. # set ::enable_shared_cache [sqlite3_enable_shared_cache] sqlite3_enable_shared_cache 1 |
︙ | ︙ |
Changes to test/thread_common.tcl.
1 2 3 4 5 6 7 8 9 10 11 | # 2007 September 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # | | < < | < < < < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 2007 September 10 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # 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. # #*********************************************************************** # # $Id: thread_common.tcl,v 1.5 2009/03/26 14:48:07 danielk1977 Exp $ if {[info exists ::thread_procs]} { return 0 } # The following script is sourced by every thread spawned using # [sqlthread spawn]: set thread_procs { # Execute the supplied SQL using database handle $::DB. |
︙ | ︙ | |||
86 87 88 89 90 91 92 93 | } } } proc thread_spawn {varname args} { sqlthread spawn $varname [join $args ;] } | > > > > > > > > > > > > > > > > > > > > > | > > > > > > | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | } } } proc thread_spawn {varname args} { sqlthread spawn $varname [join $args ;] } # Return true if this build can run the multi-threaded tests. # proc run_thread_tests {{print_warning 0}} { ifcapable !mutex { set zProblem "SQLite build is not threadsafe" } if {[info commands sqlthread] eq ""} { set zProblem "SQLite build is not threadsafe" } if {![info exists ::tcl_platform(threaded)]} { set zProblem "Linked against a non-threadsafe Tcl build" } if {[info exists zProblem]} { if {$print_warning} { if {[info exists ::run_thread_tests_failed]} { puts "WARNING: Multi-threaded tests skipped: $zProblem" } } else { puts "Skipping thread tests: $zProblem" set ::run_thread_tests_failed 1 } return 0 } return 1; } return 0 |