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

Merge all recent enhancements from trunk.

FossilOrigin-Name: 6a7ee04b0ddac36a87d5ed2ac89a53e537f4d5a3
This commit is contained in:
drh
2016-03-16 01:16:30 +00:00
107 changed files with 2011 additions and 923 deletions

View File

@ -374,6 +374,12 @@ proc do_not_use_codec {} {
reset_db
}
# Return true if the "reserved_bytes" integer on database files is non-zero.
#
proc nonzero_reserved_bytes {} {
return [sqlite3 -has-codec]
}
# Print a HELP message and exit
#
proc print_help_and_quit {} {
@ -411,6 +417,8 @@ if {[info exists cmdlinearg]==0} {
# --match=$pattern
# --verbose=$val
# --output=$filename
# -q Reduce output
# --testdir=$dir Run tests in subdirectory $dir
# --help
#
set cmdlinearg(soft-heap-limit) 0
@ -425,6 +433,7 @@ if {[info exists cmdlinearg]==0} {
set cmdlinearg(match) ""
set cmdlinearg(verbose) ""
set cmdlinearg(output) ""
set cmdlinearg(testdir) "testdir"
set leftover [list]
foreach a $argv {
@ -454,6 +463,7 @@ if {[info exists cmdlinearg]==0} {
}
{^-+binarylog=.+$} {
foreach {dummy cmdlinearg(binarylog)} [split $a =] break
set cmdlinearg(binarylog) [file normalize $cmdlinearg(binarylog)]
}
{^-+soak=.+$} {
foreach {dummy cmdlinearg(soak)} [split $a =] break
@ -486,6 +496,7 @@ if {[info exists cmdlinearg]==0} {
{^-+output=.+$} {
foreach {dummy cmdlinearg(output)} [split $a =] break
set cmdlinearg(output) [file normalize $cmdlinearg(output)]
if {$cmdlinearg(verbose)==""} {
set cmdlinearg(verbose) 2
}
@ -498,6 +509,9 @@ if {[info exists cmdlinearg]==0} {
error "option --verbose= must be set to a boolean or to \"file\""
}
}
{^-+testdir=.*$} {
foreach {dummy cmdlinearg(testdir)} [split $a =] break
}
{.*help.*} {
print_help_and_quit
}
@ -507,10 +521,18 @@ if {[info exists cmdlinearg]==0} {
}
default {
lappend leftover $a
lappend leftover [file normalize $a]
}
}
}
set testdir [file normalize $testdir]
set cmdlinearg(TESTFIXTURE_HOME) [pwd]
set cmdlinearg(INFO_SCRIPT) [file normalize [info script]]
set argv0 [file normalize $argv0]
if {$cmdlinearg(testdir)!=""} {
file mkdir $cmdlinearg(testdir)
cd $cmdlinearg(testdir)
}
set argv $leftover
# Install the malloc layer used to inject OOM errors. And the 'automatic'
@ -2120,6 +2142,24 @@ proc test_restore_config_pagecache {} {
sqlite3 db test.db
}
# Find the name of the 'shell' executable (e.g. "sqlite3.exe") to use for
# the tests in shell[1-5].test. If no such executable can be found, invoke
# [finish_test ; return] in the callers context.
#
proc test_find_cli {} {
if {$::tcl_platform(platform)=="windows"} {
set ret "sqlite3.exe"
} else {
set ret "sqlite3"
}
set ret [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $ret]]
if {![file executable $ret]} {
finish_test
return -code return
}
return $ret
}
# If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
# to non-zero, then set the global variable $AUTOVACUUM to 1.
set AUTOVACUUM $sqlite_options(default_autovacuum)