SQLite

Check-in [fb09152db8]
Login

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

Overview
Comment:Do not do the *-closeallfiles test for notify2.test. It uses multiple threads.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fb09152db879211986a7161a96a61da1425f79ef
User & Date: dan 2010-07-06 11:26:16.000
Context
2010-07-06
20:33
Modified the xWrite() method on Windows to differentiate between IO and disk full error returns. (check-in: ca4b7ffbd4 user: shaneh tags: trunk)
11:26
Do not do the *-closeallfiles test for notify2.test. It uses multiple threads. (check-in: fb09152db8 user: dan tags: trunk)
10:55
Before calling Tcl_ExitThread() in a multi-threaded test, call Tcl_DoOneEvent() as many times as necessary to handle any queued events. (check-in: b3399b4078 user: dan tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to test/permutations.test.
117
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
154
155








156
157
158
159
160
161
162
117
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
154
155
156
157
158
159
160
161
162







-

















-
-
-
-
-
-
-







+
+
+
+
+
+
+
+








#-------------------------------------------------------------------------
# Define the generic test suites:
#
#   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)
}

test_suite "threads" -prefix "" -description {
  All multi-threaded tests.
} -files {
  notify2.test   thread001.test thread002.test thread003.test 
  thread004.test thread005.test walthread.test
}


lappend ::testsuitelist xxx
#-------------------------------------------------------------------------
# Define the coverage related test suites:
#
#   coverage-wal
#
Changes to test/tester.tcl.
1157
1158
1159
1160
1161
1162
1163





1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178

1179
1180
1181
1182
1183
1184
1185
1186
1187
1188

1189
1190
1191
1192
1193
1194
1195
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193

1194
1195
1196
1197
1198
1199
1200
1201







+
+
+
+
+















+









-
+







  interp eval tinterp [list array set ::G [array get ::G]]

  # Load the various test interfaces implemented in C.
  load_testfixture_extensions tinterp

  # Run the test script.
  interp eval tinterp $script

  # Check if the interpreter call [run_thread_tests]
  if { [interp eval tinterp {info exists ::run_thread_tests_called}] } {
    set ::run_thread_tests_called 1
  }

  # Delete the interpreter used to run the test script.
  interp delete tinterp
}

proc slave_test_file {zFile} {
  set tail [file tail $zFile]

  # Remember the value of the shared-cache setting. So that it is possible
  # to check afterwards that it was not modified by the test script.
  #
  ifcapable shared_cache { set scs [sqlite3_enable_shared_cache] }

  # Run the test script in a slave interpreter.
  #
  unset -nocomplain ::run_thread_tests_called
  reset_prng_state
  set ::sqlite_open_file_count 0
  set time [time { slave_test_script [list source $zFile] }]
  set ms [expr [lindex $time 0] / 1000]

  # Test that all files opened by the test script were closed. Omit this
  # if the test script has "thread" in its name. The open file counter
  # is not thread-safe.
  #
  if {[string match *thread* $tail]==0} {
  if {[info exists ::run_thread_tests_called]==0} {
    do_test ${tail}-closeallfiles { expr {$::sqlite_open_file_count>0} } {0}
  }
  set ::sqlite_open_file_count 0

  # Test that the global "shared-cache" setting was not altered by 
  # the test script.
  #
Changes to test/thread_common.tcl.
92
93
94
95
96
97
98
99
100
101

102
103
104
105
106
107
108

109
110
111
112
113
92
93
94
95
96
97
98



99





100
101
102
103
104
105
106
107







-
-
-
+
-
-
-
-
-


+





  if {[info commands sqlthread] eq ""} {
    set zProblem "SQLite build is not threadsafe"
  }
  if {![info exists ::tcl_platform(threaded)]} {
    set zProblem "Linked against a non-threadsafe Tcl build"
  }
  if {[info exists zProblem]} {
    if {$print_warning} {
      if {[info exists ::run_thread_tests_failed]} {
        puts "WARNING: Multi-threaded tests skipped: $zProblem"
    puts "WARNING: Multi-threaded tests skipped: $zProblem"
      }
    } else {
      puts "Skipping thread tests: $zProblem"
      set ::run_thread_tests_failed 1
    }
    return 0
  }
  set ::run_thread_tests_called 1
  return 1;
}

return 0