/ Check-in [c1c9f6fa]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a problem introduced into lock2.test by the previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c1c9f6fa9d75df740e577dbc5e6a24b91ad2bdd0
User & Date: dan 2010-06-15 18:00:06
Context
2010-06-15
19:07
Rationalize a common pattern in tcl test cases into proc do_multiclient_test. check-in: efe44564 user: dan tags: trunk
18:00
Fix a problem introduced into lock2.test by the previous commit. check-in: c1c9f6fa user: dan tags: trunk
17:44
Add test file pager1.test, containing tests of inter-process locking in non-wal mode. check-in: 6e43eed9 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/lock2.test.

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
75
76
77
78
79
80
81
82
83
84
85

86
87
88
89
90
91
92
      BEGIN;
      SELECT * FROM sqlite_master;
    }
  }
} {}
do_test lock2-1.4 {
  testfixture $::tf1 {
    db eval {
      CREATE TABLE def(d, e, f)
    }
  }
} {database is locked}
do_test lock2-1.5 {
  catchsql {
    COMMIT;
  }
} {1 {database is locked}}
................................................................................
      SELECT * FROM sqlite_master;
      COMMIT;
    }
  }
} {}
do_test lock2-1.7 {
  testfixture $::tf1 {
    db eval {
      BEGIN;
      SELECT * FROM sqlite_master;
    }

  }
} {database is locked}
do_test lock2-1.8 {
  catchsql {
    COMMIT;
  }
} {0 {}}







|
|
<







 







|


|
>







55
56
57
58
59
60
61
62
63

64
65
66
67
68
69
70
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
      BEGIN;
      SELECT * FROM sqlite_master;
    }
  }
} {}
do_test lock2-1.4 {
  testfixture $::tf1 {
    catch { db eval { CREATE TABLE def(d, e, f) } } msg
    set msg

  }
} {database is locked}
do_test lock2-1.5 {
  catchsql {
    COMMIT;
  }
} {1 {database is locked}}
................................................................................
      SELECT * FROM sqlite_master;
      COMMIT;
    }
  }
} {}
do_test lock2-1.7 {
  testfixture $::tf1 {
    catch { db eval {
      BEGIN;
      SELECT * FROM sqlite_master;
    } } msg 
    set msg
  }
} {database is locked}
do_test lock2-1.8 {
  catchsql {
    COMMIT;
  }
} {0 {}}

Changes to test/permutations.test.

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

36
37
38
39
40
41
42
..
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
...
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
773
774
775
776
777
778
779
780
781
782
783
784

785
786
787
788
789
790
791
792
793
794
795
796
# where available options are:  
#
#       -description TITLE                  (default "")
#       -initialize  SCRIPT                 (default "")
#       -shutdown    SCRIPT                 (default "")
#       -presql      SQL                    (default "")
#       -files       LIST-OF-FILES          (default $::ALLTESTS)
#
#
proc test_suite {name args} {

  set default(-shutdown)    ""
  set default(-initialize)  ""
  set default(-presql)      ""
  set default(-description) "no description supplied (fixme)"
  set default(-files)     ""


  array set options [array get default]
  if {[llength $args]%2} {
    error "uneven number of options/switches passed to test_suite"
  }
  foreach {k v} $args {
    set o [array names options ${k}*]
................................................................................
}

#-------------------------------------------------------------------------
# Set up the following global list variables containing the names of 
# various test scripts:
#
#   $alltests
#   $slowtests
#

set alltests [list]
foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
if {$::tcl_platform(platform)!="unix"} {
  set alltests [test_set $alltests -exclude crash.test crash2.test]
}
set alltests [test_set $alltests -exclude {
  all.test        async.test         quick.test  veryquick.test
................................................................................
#   veryquick
#   quick
#   full
#   veryquick_plus_notify2
#
lappend ::testsuitelist xxx

test_suite "veryquick" -description {
  "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault*
]

test_suite "quick" -description {
  Quick test suite. Runs in around 10 minutes on a workstation.
} -files [
  test_set $allquicktests
]

test_suite "veryquick_plus_notify2" -description {
  Very quick test suite + file notify2.test. This is used by one of the 
  sqlite.org release test configurations.
} -files [ 
  test_set $allquicktests notify2.test -exclude *malloc* *ioerr* *fault*
]

test_suite "full" -description {
  Full test suite. Takes a long time.
} -files [ 
  test_set $alltests 
] -initialize {
  unset -nocomplain ::G(isquick)
}

................................................................................
# End of tests
#############################################################################

# run_tests NAME OPTIONS
#
# where available options are:  
#
#       -description TITLE                  (default "")
#       -initialize  SCRIPT                 (default "")
#       -shutdown    SCRIPT                 (default "")
#       -presql      SQL                    (default "")
#       -files       LIST-OF-FILES          (default "")

#
proc run_tests {name args} {
  array set options $args

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

  uplevel $options(-initialize)

  foreach file [lsort $options(-files)] {
    slave_test_file $::testdir/$file







|







|
>







 







|

<







 







|







|





|






|







 







|
|
|
|
|
>




|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
76
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
...
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
...
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
# where available options are:  
#
#       -description TITLE                  (default "")
#       -initialize  SCRIPT                 (default "")
#       -shutdown    SCRIPT                 (default "")
#       -presql      SQL                    (default "")
#       -files       LIST-OF-FILES          (default $::ALLTESTS)
#       -prefix      NAME                   (default "$::NAME.")
#
proc test_suite {name args} {

  set default(-shutdown)    ""
  set default(-initialize)  ""
  set default(-presql)      ""
  set default(-description) "no description supplied (fixme)"
  set default(-files)       ""
  set default(-prefix)      "${name}."

  array set options [array get default]
  if {[llength $args]%2} {
    error "uneven number of options/switches passed to test_suite"
  }
  foreach {k v} $args {
    set o [array names options ${k}*]
................................................................................
}

#-------------------------------------------------------------------------
# Set up the following global list variables containing the names of 
# various test scripts:
#
#   $alltests
#   $allquicktests
#

set alltests [list]
foreach f [glob $testdir/*.test] { lappend alltests [file tail $f] }
if {$::tcl_platform(platform)!="unix"} {
  set alltests [test_set $alltests -exclude crash.test crash2.test]
}
set alltests [test_set $alltests -exclude {
  all.test        async.test         quick.test  veryquick.test
................................................................................
#   veryquick
#   quick
#   full
#   veryquick_plus_notify2
#
lappend ::testsuitelist xxx

test_suite "veryquick" -prefix "" -description {
  "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
  This test suite is the same as the "quick" tests, except that some files
  that test malloc and IO errors are omitted.
} -files [
  test_set $allquicktests -exclude *malloc* *ioerr* *fault*
]

test_suite "quick" -prefix "" -description {
  Quick test suite. Runs in around 10 minutes on a workstation.
} -files [
  test_set $allquicktests
]

test_suite "veryquick_plus_notify2" -prefix "" -description {
  Very quick test suite + file notify2.test. This is used by one of the 
  sqlite.org release test configurations.
} -files [ 
  test_set $allquicktests notify2.test -exclude *malloc* *ioerr* *fault*
]

test_suite "full" -prefix "" -description {
  Full test suite. Takes a long time.
} -files [ 
  test_set $alltests 
] -initialize {
  unset -nocomplain ::G(isquick)
}

................................................................................
# End of tests
#############################################################################

# run_tests NAME OPTIONS
#
# where available options are:  
#
#       -description TITLE
#       -initialize  SCRIPT
#       -shutdown    SCRIPT
#       -presql      SQL
#       -files       LIST-OF-FILES
#       -prefix      NAME
#
proc run_tests {name args} {
  array set options $args

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

  uplevel $options(-initialize)

  foreach file [lsort $options(-files)] {
    slave_test_file $::testdir/$file

Changes to test/tester.tcl.

295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
        break
      }
    }
  }
  if {!$go} return

  if {[info exists ::G(perm:name)]} {
    set name "$::G(perm:name).$name"
  }

  incr_ntest
  puts -nonewline $name...
  flush stdout
  if {[catch {uplevel #0 "$cmd;\n"} result]} {
    puts "\nError: $result"







|







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
        break
      }
    }
  }
  if {!$go} return

  if {[info exists ::G(perm:name)]} {
    set name "$::G(perm:name)$name"
  }

  incr_ntest
  puts -nonewline $name...
  flush stdout
  if {[catch {uplevel #0 "$cmd;\n"} result]} {
    puts "\nError: $result"