SQLite

Check-in [b753d849fe]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Merge the permutations fix from trunk.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | read-only-shadow
Files: files | file ages | folders
SHA3-256: b753d849fe0524e14ae9367a47e29be76332fafb77bfe13e266aeef1ef6742ce
User & Date: drh 2018-11-07 13:41:27.488
Context
2018-11-07
14:41
More test-case adjustments for defensive mode. (check-in: 911e8a17a3 user: drh tags: read-only-shadow)
13:41
Merge the permutations fix from trunk. (check-in: b753d849fe user: drh tags: read-only-shadow)
11:56
Partially revert [3e1a2f661], as some test scripts require separate $presql and $dbconfig variables. (check-in: cbf85284be user: dan tags: trunk)
02:17
Add the SQLITE_DEFAULT_DEFENSIVE compile-time option. Fix up test cases so that they work with DEFENSIVE enabled. (check-in: 3212733cb6 user: drh tags: read-only-shadow)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/permutations.test.
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  foreach {k v} $args {
    set o [array names options ${k}*]
    if {[llength $o]>1}  { error "ambiguous option: $k" }
    if {[llength $o]==0} { error "unknown option: $k" }
    set options([lindex $o 0]) $v
  }

  # Transform "-presql" into a "dbconfig" script
  #
  if {[info exists options(-presql)]} {
    append options(-dbconfig) "\n\$::dbhandle eval { $options(-presql) }"
    unset options(-presql)
  }

  set     ::testspec($name) [array get options]
  lappend ::testsuitelist $name
}

#-------------------------------------------------------------------------
# test_set ARGS...
#







<
<
<
<
<
<
<







44
45
46
47
48
49
50







51
52
53
54
55
56
57
  foreach {k v} $args {
    set o [array names options ${k}*]
    if {[llength $o]>1}  { error "ambiguous option: $k" }
    if {[llength $o]==0} { error "unknown option: $k" }
    set options([lindex $o 0]) $v
  }








  set     ::testspec($name) [array get options]
  lappend ::testsuitelist $name
}

#-------------------------------------------------------------------------
# test_set ARGS...
#
1086
1087
1088
1089
1090
1091
1092

1093
1094
1095
1096
1097
1098
1099

1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112

1113
1114
1115
1116
1117
1118
1119
#       -dbconfig    SCRIPT
#
proc run_tests {name args} {
  set options(-initialize) ""
  set options(-shutdown) ""
  set options(-prefix) ""
  set options(-dbconfig) ""


  array set options $args

  set ::G(perm:name)         $name
  set ::G(perm:prefix)       $options(-prefix)
  set ::G(isquick)           1
  set ::G(perm:dbconfig)     $options(-dbconfig)


  foreach file [lsort $options(-files)] {
    uplevel $options(-initialize)
    if {[file tail $file] == $file} { set file [file join $::testdir $file] }
    slave_test_file $file
    uplevel $options(-shutdown)

    unset -nocomplain ::G(perm:sqlite3_args)
  }

  unset ::G(perm:name)
  unset ::G(perm:prefix)
  unset ::G(perm:dbconfig)

}

proc run_test_suite {name} {
  if {[info exists ::testspec($name)]==0} {
    error "No such test suite: $name"
  }
  uplevel run_tests $name $::testspec($name)







>







>













>







1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
#       -dbconfig    SCRIPT
#
proc run_tests {name args} {
  set options(-initialize) ""
  set options(-shutdown) ""
  set options(-prefix) ""
  set options(-dbconfig) ""
  set options(-presql) ""

  array set options $args

  set ::G(perm:name)         $name
  set ::G(perm:prefix)       $options(-prefix)
  set ::G(isquick)           1
  set ::G(perm:dbconfig)     $options(-dbconfig)
  set ::G(perm:presql)       $options(-presql)

  foreach file [lsort $options(-files)] {
    uplevel $options(-initialize)
    if {[file tail $file] == $file} { set file [file join $::testdir $file] }
    slave_test_file $file
    uplevel $options(-shutdown)

    unset -nocomplain ::G(perm:sqlite3_args)
  }

  unset ::G(perm:name)
  unset ::G(perm:prefix)
  unset ::G(perm:dbconfig)
  unset ::G(perm:presql)
}

proc run_test_suite {name} {
  if {[info exists ::testspec($name)]==0} {
    error "No such test suite: $name"
  }
  uplevel run_tests $name $::testspec($name)