1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Add test file pager1.test, containing tests of inter-process locking in non-wal mode.

FossilOrigin-Name: 6e43eed9310bae9ca5e91f8fd9eafc45a16b7019
This commit is contained in:
dan
2010-06-15 17:44:47 +00:00
parent 3a3803b61a
commit e91a54e1be
6 changed files with 235 additions and 27 deletions

View File

@ -30,6 +30,7 @@ proc launch_testfixture {} {
# Execute a command in a child testfixture process, connected by two-way
# channel $chan. Return the result of the command, or an error message.
#
proc testfixture {chan cmd} {
puts $chan $cmd
puts $chan OVER
@ -37,7 +38,9 @@ proc testfixture {chan cmd} {
while { 1 } {
set line [gets $chan]
if { $line == "OVER" } {
return $r
set res [lindex $r 1]
if { [lindex $r 0] } { error $res }
return $res
}
if {[eof $chan]} {
return "ERROR: Child process hung up"
@ -55,7 +58,7 @@ proc testfixture_nb_cb {varname chan} {
}
if { $line == "OVER" } {
set $varname $::tfnb($chan)
set $varname [lindex $::tfnb($chan) 1]
unset ::tfnb($chan)
close $chan
} else {
@ -89,8 +92,8 @@ puts $f {
puts $l "READ $line"
if { $line == "OVER" } {
set rc [catch {eval $script} result]
puts $result
puts $l "WRITE $result"
puts [list $rc $result]
puts $l "WRITE [list $rc $result]"
puts OVER
puts $l "WRITE OVER"
flush stdout