Index: Tests/common.eagle ================================================================== --- Tests/common.eagle +++ Tests/common.eagle @@ -593,17 +593,18 @@ # into the variable specified by the caller. # set db [sql open -type SQLite [subst $connection]] } - proc cleanupDb { fileName {varName db} } { + proc cleanupDb { fileName {varName db} {collect true} {delete true} } { # # NOTE: Attempt to force all pending "garbage" objects to be collected, # including SQLite statements and backup objects; this should allow # the underlying database file to be deleted. # - if {[catch {object invoke GC GetTotalMemory true} error]} then { + if {$collect && \ + [catch {object invoke GC GetTotalMemory true} error]} then { tputs $channel [appendArgs \ "==== WARNING: failed full garbage collection, error: " \ \n\t $error \n] } @@ -640,11 +641,11 @@ } # # NOTE: Check if the file still exists. # - if {!$isMemory && [file exists $fileName]} then { + if {!$isMemory && $delete && [file exists $fileName]} then { # # NOTE: Skip deleting database files if somebody sets the global # variable to prevent it. # if {![info exists ::no(cleanupDb)]} then { @@ -677,17 +678,18 @@ } return $code } - proc cleanupFile { fileName {force false} } { + proc cleanupFile { fileName {collect true} {force false} } { # # NOTE: Attempt to force all pending "garbage" objects to be collected, # including SQLite statements and backup objects; this should allow # the underlying database file to be deleted. # - if {[catch {object invoke GC GetTotalMemory true} error]} then { + if {$collect && \ + [catch {object invoke GC GetTotalMemory true} error]} then { tputs $channel [appendArgs \ "==== WARNING: failed full garbage collection, error: " \ \n\t $error \n] }