OLD | NEW |
1 #!/usr/bin/tclsh | 1 #!/usr/bin/tclsh |
2 # | 2 # |
3 # Documentation for this script. This may be output to stderr | 3 # Documentation for this script. This may be output to stderr |
4 # if the script is invoked incorrectly. See the [process_options] | 4 # if the script is invoked incorrectly. See the [process_options] |
5 # proc below. | 5 # proc below. |
6 # | 6 # |
7 set ::USAGE_MESSAGE { | 7 set ::USAGE_MESSAGE { |
8 This Tcl script is used to test the various configurations required | 8 This Tcl script is used to test the various configurations required |
9 before releasing a new version. Supported command line options (all | 9 before releasing a new version. Supported command line options (all |
10 optional) are: | 10 optional) are: |
11 | 11 |
12 --srcdir TOP-OF-SQLITE-TREE (see below) | 12 --buildonly (Just build testfixture - do not run) |
| 13 --config CONFIGNAME (Run only CONFIGNAME) |
| 14 --dryrun (Print what would have happened) |
| 15 -f|--force (Run even if uncommitted changes) |
| 16 --info (Show diagnostic info) |
| 17 --jobs N (Use N processes - default 1) |
| 18 --keep (Delete no files after each test run) |
| 19 --msvc (Use MSVC as the compiler) |
13 --platform PLATFORM (see below) | 20 --platform PLATFORM (see below) |
14 --config CONFIGNAME (Run only CONFIGNAME) | 21 --progress (Show progress messages) |
15 --quick (Run "veryquick.test" only) | 22 --quick (Run "veryquick.test" only) |
16 --veryquick (Run "make smoketest" only) | 23 --veryquick (Run "make smoketest" only) |
17 --msvc (Use MSVC as the compiler) | |
18 --buildonly (Just build testfixture - do not run) | |
19 --dryrun (Print what would have happened) | |
20 --info (Show diagnostic info) | |
21 --with-tcl=DIR (Use TCL build at DIR) | 24 --with-tcl=DIR (Use TCL build at DIR) |
22 --jobs N (Use N processes - default 1) | |
23 --progress (Show progress messages) | |
24 | |
25 The default value for --srcdir is the parent of the directory holding | |
26 this script. | |
27 | 25 |
28 The script determines the default value for --platform using the | 26 The script determines the default value for --platform using the |
29 $tcl_platform(os) and $tcl_platform(machine) variables. Supported | 27 $tcl_platform(os) and $tcl_platform(machine) variables. Supported |
30 platforms are "Linux-x86", "Linux-x86_64", "Darwin-i386", | 28 platforms are "Linux-x86", "Linux-x86_64", "Darwin-i386", |
31 "Darwin-x86_64", "Windows NT-intel", and "Windows NT-amd64". | 29 "Darwin-x86_64", "Windows NT-intel", and "Windows NT-amd64". |
32 | 30 |
33 Every test begins with a fresh run of the configure script at the top | 31 Every test begins with a fresh run of the configure script at the top |
34 of the SQLite source tree. | 32 of the SQLite source tree. |
35 } | 33 } |
36 | 34 |
37 # Return a timestamp of the form HH:MM:SS | 35 # Return a timestamp of the form HH:MM:SS |
38 # | 36 # |
39 proc now {} { | 37 proc now {} { |
40 return [clock format [clock seconds] -format %H:%M:%S] | 38 return [clock format [clock seconds] -format %H:%M:%S] |
41 } | 39 } |
42 | 40 |
43 # Omit comments (text between # and \n) in a long multi-line string. | 41 # Omit comments (text between # and \n) in a long multi-line string. |
44 # | 42 # |
45 proc strip_comments {in} { | 43 proc strip_comments {in} { |
46 regsub -all {#[^\n]*\n} $in {} out | 44 regsub -all {#[^\n]*\n} $in {} out |
47 return $out | 45 return $out |
48 } | 46 } |
49 | 47 |
50 array set ::Configs [strip_comments { | 48 array set ::Configs [strip_comments { |
51 "Default" { | 49 "Default" { |
52 -O2 | 50 -O2 |
53 --disable-amalgamation --disable-shared | 51 --disable-amalgamation --disable-shared |
| 52 --enable-session |
54 } | 53 } |
55 "Sanitize" { | 54 "Sanitize" { |
56 CC=clang -fsanitize=undefined | 55 CC=clang -fsanitize=undefined |
57 -DSQLITE_ENABLE_STAT4 | 56 -DSQLITE_ENABLE_STAT4 |
| 57 --enable-session |
| 58 } |
| 59 "Stdcall" { |
| 60 -DUSE_STDCALL=1 |
| 61 -O2 |
58 } | 62 } |
59 "Have-Not" { | 63 "Have-Not" { |
60 # The "Have-Not" configuration sets all possible -UHAVE_feature options | 64 # The "Have-Not" configuration sets all possible -UHAVE_feature options |
61 # in order to verify that the code works even on platforms that lack | 65 # in order to verify that the code works even on platforms that lack |
62 # these support services. | 66 # these support services. |
63 -DHAVE_FDATASYNC=0 | 67 -DHAVE_FDATASYNC=0 |
64 -DHAVE_GMTIME_R=0 | 68 -DHAVE_GMTIME_R=0 |
65 -DHAVE_ISNAN=0 | 69 -DHAVE_ISNAN=0 |
66 -DHAVE_LOCALTIME_R=0 | 70 -DHAVE_LOCALTIME_R=0 |
67 -DHAVE_LOCALTIME_S=0 | 71 -DHAVE_LOCALTIME_S=0 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 -DSQLITE_ENABLE_MEMSYS3=1 | 103 -DSQLITE_ENABLE_MEMSYS3=1 |
100 -DSQLITE_ENABLE_COLUMN_METADATA=1 | 104 -DSQLITE_ENABLE_COLUMN_METADATA=1 |
101 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 | 105 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 |
102 -DSQLITE_SECURE_DELETE=1 | 106 -DSQLITE_SECURE_DELETE=1 |
103 -DSQLITE_SOUNDEX=1 | 107 -DSQLITE_SOUNDEX=1 |
104 -DSQLITE_ENABLE_ATOMIC_WRITE=1 | 108 -DSQLITE_ENABLE_ATOMIC_WRITE=1 |
105 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 | 109 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 |
106 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 | 110 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 |
107 -DSQLITE_ENABLE_STAT4 | 111 -DSQLITE_ENABLE_STAT4 |
108 -DSQLITE_ENABLE_STMT_SCANSTATUS | 112 -DSQLITE_ENABLE_STMT_SCANSTATUS |
109 --enable-json1 --enable-fts5 | 113 --enable-json1 --enable-fts5 --enable-session |
110 } | 114 } |
111 "Debug-One" { | 115 "Debug-One" { |
112 --disable-shared | 116 --disable-shared |
113 -O2 | 117 -O2 |
114 -DSQLITE_DEBUG=1 | 118 -DSQLITE_DEBUG=1 |
115 -DSQLITE_MEMDEBUG=1 | 119 -DSQLITE_MEMDEBUG=1 |
116 -DSQLITE_MUTEX_NOOP=1 | 120 -DSQLITE_MUTEX_NOOP=1 |
117 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 | 121 -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 |
118 -DSQLITE_ENABLE_FTS3=1 | 122 -DSQLITE_ENABLE_FTS3=1 |
119 -DSQLITE_ENABLE_RTREE=1 | 123 -DSQLITE_ENABLE_RTREE=1 |
120 -DSQLITE_ENABLE_MEMSYS5=1 | 124 -DSQLITE_ENABLE_MEMSYS5=1 |
121 -DSQLITE_ENABLE_MEMSYS3=1 | |
122 -DSQLITE_ENABLE_COLUMN_METADATA=1 | 125 -DSQLITE_ENABLE_COLUMN_METADATA=1 |
123 -DSQLITE_ENABLE_STAT4 | 126 -DSQLITE_ENABLE_STAT4 |
124 -DSQLITE_ENABLE_HIDDEN_COLUMNS | 127 -DSQLITE_ENABLE_HIDDEN_COLUMNS |
125 -DSQLITE_MAX_ATTACHED=125 | 128 -DSQLITE_MAX_ATTACHED=125 |
126 } | 129 } |
127 "Fast-One" { | 130 "Fast-One" { |
128 -O6 | 131 -O6 |
129 -DSQLITE_ENABLE_FTS4=1 | 132 -DSQLITE_ENABLE_FTS4=1 |
130 -DSQLITE_ENABLE_RTREE=1 | 133 -DSQLITE_ENABLE_RTREE=1 |
131 -DSQLITE_ENABLE_STAT4 | 134 -DSQLITE_ENABLE_STAT4 |
132 -DSQLITE_ENABLE_RBU | 135 -DSQLITE_ENABLE_RBU |
133 -DSQLITE_MAX_ATTACHED=125 | 136 -DSQLITE_MAX_ATTACHED=125 |
134 -DLONGDOUBLE_TYPE=double | 137 -DLONGDOUBLE_TYPE=double |
| 138 --enable-session |
135 } | 139 } |
136 "Device-One" { | 140 "Device-One" { |
137 -O2 | 141 -O2 |
138 -DSQLITE_DEBUG=1 | 142 -DSQLITE_DEBUG=1 |
139 -DSQLITE_DEFAULT_AUTOVACUUM=1 | 143 -DSQLITE_DEFAULT_AUTOVACUUM=1 |
140 -DSQLITE_DEFAULT_CACHE_SIZE=64 | 144 -DSQLITE_DEFAULT_CACHE_SIZE=64 |
141 -DSQLITE_DEFAULT_PAGE_SIZE=1024 | 145 -DSQLITE_DEFAULT_PAGE_SIZE=1024 |
142 -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=32 | 146 -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=32 |
143 -DSQLITE_DISABLE_LFS=1 | 147 -DSQLITE_DISABLE_LFS=1 |
144 -DSQLITE_ENABLE_ATOMIC_WRITE=1 | 148 -DSQLITE_ENABLE_ATOMIC_WRITE=1 |
(...skipping 16 matching lines...) Expand all Loading... |
161 -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=1000 | 165 -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=1000 |
162 -DSQLITE_DISABLE_LFS=1 | 166 -DSQLITE_DISABLE_LFS=1 |
163 -DSQLITE_ENABLE_FTS3=1 | 167 -DSQLITE_ENABLE_FTS3=1 |
164 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 | 168 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 |
165 -DSQLITE_ENABLE_RTREE=1 | 169 -DSQLITE_ENABLE_RTREE=1 |
166 -DSQLITE_MAX_COMPOUND_SELECT=50 | 170 -DSQLITE_MAX_COMPOUND_SELECT=50 |
167 -DSQLITE_MAX_PAGE_SIZE=32768 | 171 -DSQLITE_MAX_PAGE_SIZE=32768 |
168 -DSQLITE_OMIT_TRACE=1 | 172 -DSQLITE_OMIT_TRACE=1 |
169 -DSQLITE_TEMP_STORE=3 | 173 -DSQLITE_TEMP_STORE=3 |
170 -DSQLITE_THREADSAFE=2 | 174 -DSQLITE_THREADSAFE=2 |
171 --enable-json1 --enable-fts5 | 175 --enable-json1 --enable-fts5 --enable-session |
172 } | 176 } |
173 "Locking-Style" { | 177 "Locking-Style" { |
174 -O2 | 178 -O2 |
175 -DSQLITE_ENABLE_LOCKING_STYLE=1 | 179 -DSQLITE_ENABLE_LOCKING_STYLE=1 |
176 } | 180 } |
177 "OS-X" { | 181 "Apple" { |
178 -O1 # Avoid a compiler bug in gcc 4.2.1 build 5658 | 182 -O1 # Avoid a compiler bug in gcc 4.2.1 build 5658 |
179 -DSQLITE_OMIT_LOAD_EXTENSION=1 | 183 -DHAVE_GMTIME_R=1 |
180 -DSQLITE_DEFAULT_MEMSTATUS=0 | 184 -DHAVE_ISNAN=1 |
181 -DSQLITE_THREADSAFE=2 | 185 -DHAVE_LOCALTIME_R=1 |
182 -DSQLITE_OS_UNIX=1 | 186 -DHAVE_PREAD=1 |
183 -DSQLITE_ENABLE_JSON1=1 | 187 -DHAVE_PWRITE=1 |
184 -DSQLITE_ENABLE_LOCKING_STYLE=1 | 188 -DHAVE_USLEEP=1 |
185 -DUSE_PREAD=1 | 189 -DHAVE_USLEEP=1 |
186 -DSQLITE_ENABLE_RTREE=1 | 190 -DHAVE_UTIME=1 |
| 191 -DSQLITE_DEFAULT_CACHE_SIZE=1000 |
| 192 -DSQLITE_DEFAULT_CKPTFULLFSYNC=1 |
| 193 -DSQLITE_DEFAULT_MEMSTATUS=1 |
| 194 -DSQLITE_DEFAULT_PAGE_SIZE=1024 |
| 195 -DSQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS=1 |
| 196 -DSQLITE_ENABLE_API_ARMOR=1 |
| 197 -DSQLITE_ENABLE_AUTO_PROFILE=1 |
| 198 -DSQLITE_ENABLE_FLOCKTIMEOUT=1 |
187 -DSQLITE_ENABLE_FTS3=1 | 199 -DSQLITE_ENABLE_FTS3=1 |
188 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 | 200 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 |
189 -DSQLITE_DEFAULT_CACHE_SIZE=1000 | 201 -DSQLITE_ENABLE_FTS3_TOKENIZER=1 |
| 202 if:os=="Darwin" -DSQLITE_ENABLE_LOCKING_STYLE=1 |
| 203 -DSQLITE_ENABLE_PERSIST_WAL=1 |
| 204 -DSQLITE_ENABLE_PURGEABLE_PCACHE=1 |
| 205 -DSQLITE_ENABLE_RTREE=1 |
| 206 -DSQLITE_ENABLE_SNAPSHOT=1 |
| 207 # -DSQLITE_ENABLE_SQLLOG=1 |
| 208 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 |
190 -DSQLITE_MAX_LENGTH=2147483645 | 209 -DSQLITE_MAX_LENGTH=2147483645 |
191 -DSQLITE_MAX_VARIABLE_NUMBER=500000 | 210 -DSQLITE_MAX_VARIABLE_NUMBER=500000 |
192 -DSQLITE_DEBUG=1 | 211 # -DSQLITE_MEMDEBUG=1 |
| 212 -DSQLITE_NO_SYNC=1 |
| 213 -DSQLITE_OMIT_AUTORESET=1 |
| 214 -DSQLITE_OMIT_LOAD_EXTENSION=1 |
193 -DSQLITE_PREFER_PROXY_LOCKING=1 | 215 -DSQLITE_PREFER_PROXY_LOCKING=1 |
194 -DSQLITE_ENABLE_API_ARMOR=1 | 216 -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 |
| 217 -DSQLITE_THREADSAFE=2 |
| 218 -DSQLITE_USE_URI=1 |
| 219 -DSQLITE_WRITE_WALFRAME_PREBUFFERED=1 |
| 220 -DUSE_GUARDED_FD=1 |
| 221 -DUSE_PREAD=1 |
195 --enable-json1 --enable-fts5 | 222 --enable-json1 --enable-fts5 |
196 } | 223 } |
197 "Extra-Robustness" { | 224 "Extra-Robustness" { |
198 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 | 225 -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 |
199 -DSQLITE_MAX_ATTACHED=62 | 226 -DSQLITE_MAX_ATTACHED=62 |
200 } | 227 } |
201 "Devkit" { | 228 "Devkit" { |
202 -DSQLITE_DEFAULT_FILE_FORMAT=4 | 229 -DSQLITE_DEFAULT_FILE_FORMAT=4 |
203 -DSQLITE_MAX_ATTACHED=30 | 230 -DSQLITE_MAX_ATTACHED=30 |
204 -DSQLITE_ENABLE_COLUMN_METADATA | 231 -DSQLITE_ENABLE_COLUMN_METADATA |
205 -DSQLITE_ENABLE_FTS4 | 232 -DSQLITE_ENABLE_FTS4 |
| 233 -DSQLITE_ENABLE_FTS5 |
206 -DSQLITE_ENABLE_FTS4_PARENTHESIS | 234 -DSQLITE_ENABLE_FTS4_PARENTHESIS |
207 -DSQLITE_DISABLE_FTS4_DEFERRED | 235 -DSQLITE_DISABLE_FTS4_DEFERRED |
208 -DSQLITE_ENABLE_RTREE | 236 -DSQLITE_ENABLE_RTREE |
209 --enable-json1 --enable-fts5 | 237 --enable-json1 --enable-fts5 |
210 } | 238 } |
211 "No-lookaside" { | 239 "No-lookaside" { |
212 -DSQLITE_TEST_REALLOC_STRESS=1 | 240 -DSQLITE_TEST_REALLOC_STRESS=1 |
213 -DSQLITE_OMIT_LOOKASIDE=1 | 241 -DSQLITE_OMIT_LOOKASIDE=1 |
214 -DHAVE_USLEEP=1 | 242 -DHAVE_USLEEP=1 |
215 } | 243 } |
(...skipping 24 matching lines...) Expand all Loading... |
240 "Fast-One" fuzztest | 268 "Fast-One" fuzztest |
241 "Debug-One" "mptest test" | 269 "Debug-One" "mptest test" |
242 "Have-Not" test | 270 "Have-Not" test |
243 "Secure-Delete" test | 271 "Secure-Delete" test |
244 "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" | 272 "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" |
245 "Update-Delete-Limit" test | 273 "Update-Delete-Limit" test |
246 "Extra-Robustness" test | 274 "Extra-Robustness" test |
247 "Device-Two" test | 275 "Device-Two" test |
248 "No-lookaside" test | 276 "No-lookaside" test |
249 "Devkit" test | 277 "Devkit" test |
| 278 "Apple" test |
250 "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} | 279 "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} |
251 "Device-One" fulltest | 280 "Device-One" fulltest |
252 "Default" "threadtest fulltest" | 281 "Default" "threadtest fulltest" |
253 "Valgrind" valgrindtest | 282 "Valgrind" valgrindtest |
254 } | 283 } |
255 Linux-i686 { | 284 Linux-i686 { |
256 "Devkit" test | 285 "Devkit" test |
257 "Have-Not" test | 286 "Have-Not" test |
258 "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" | 287 "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" |
259 "Device-One" test | 288 "Device-One" test |
260 "Device-Two" test | 289 "Device-Two" test |
261 "Default" "threadtest fulltest" | 290 "Default" "threadtest fulltest" |
262 } | 291 } |
263 Darwin-i386 { | 292 Darwin-i386 { |
264 "Locking-Style" "mptest test" | 293 "Locking-Style" "mptest test" |
265 "Have-Not" test | 294 "Have-Not" test |
266 "OS-X" "threadtest fulltest" | 295 "Apple" "threadtest fulltest" |
267 } | 296 } |
268 Darwin-x86_64 { | 297 Darwin-x86_64 { |
269 "Locking-Style" "mptest test" | 298 "Locking-Style" "mptest test" |
270 "Have-Not" test | 299 "Have-Not" test |
271 "OS-X" "threadtest fulltest" | 300 "Apple" "threadtest fulltest" |
272 } | 301 } |
273 "Windows NT-intel" { | 302 "Windows NT-intel" { |
| 303 "Stdcall" test |
274 "Have-Not" test | 304 "Have-Not" test |
275 "Default" "mptest fulltestonly" | 305 "Default" "mptest fulltestonly" |
276 } | 306 } |
277 "Windows NT-amd64" { | 307 "Windows NT-amd64" { |
| 308 "Stdcall" test |
278 "Have-Not" test | 309 "Have-Not" test |
279 "Default" "mptest fulltestonly" | 310 "Default" "mptest fulltestonly" |
280 } | 311 } |
281 | 312 |
282 # The Failure-Detection platform runs various tests that deliberately | 313 # The Failure-Detection platform runs various tests that deliberately |
283 # fail. This is used as a test of this script to verify that this script | 314 # fail. This is used as a test of this script to verify that this script |
284 # correctly identifies failures. | 315 # correctly identifies failures. |
285 # | 316 # |
286 Failure-Detection { | 317 Failure-Detection { |
287 Fail0 "TEST_FAILURE=0 test" | 318 Fail0 "TEST_FAILURE=0 test" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 # list in the same format as each element of the list passed to the | 461 # list in the same format as each element of the list passed to the |
431 # [run_all_test_suites] command in the master process. | 462 # [run_all_test_suites] command in the master process. |
432 # | 463 # |
433 # The slave then runs the "configure && make test" commands specified. It | 464 # The slave then runs the "configure && make test" commands specified. It |
434 # exits successfully if the tests passes, or with a non-zero error code | 465 # exits successfully if the tests passes, or with a non-zero error code |
435 # otherwise. | 466 # otherwise. |
436 # | 467 # |
437 proc run_slave_test {} { | 468 proc run_slave_test {} { |
438 # Read global vars configuration from stdin. | 469 # Read global vars configuration from stdin. |
439 set V [gets stdin] | 470 set V [gets stdin] |
440 foreach {::TRACE ::MSVC ::DRYRUN} $V {} | 471 foreach {::TRACE ::MSVC ::DRYRUN ::KEEPFILES} $V {} |
441 | 472 |
442 # Read the test-suite configuration from stdin. | 473 # Read the test-suite configuration from stdin. |
443 set T [gets stdin] | 474 set T [gets stdin] |
444 foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} | 475 foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} |
445 | 476 |
446 # Create and switch to the test directory. | 477 # Create and switch to the test directory. |
447 set ::env(SQLITE_TMPDIR) [file normalize $dir] | 478 set normaldir [file normalize $dir] |
| 479 set ::env(SQLITE_TMPDIR) $normaldir |
448 trace_cmd file mkdir $dir | 480 trace_cmd file mkdir $dir |
449 trace_cmd cd $dir | 481 trace_cmd cd $dir |
450 catch {file delete core} | 482 catch {file delete core} |
451 catch {file delete test.log} | 483 catch {file delete test.log} |
452 | 484 |
453 # Run the "./configure && make" commands. | 485 # Run the "./configure && make" commands. |
454 set rc 0 | 486 set rc 0 |
455 set rc [catch [configureCommand $configOpts]] | 487 set rc [catch [configureCommand $configOpts]] |
456 if {!$rc} { | 488 if {!$rc} { |
457 if {[info exists ::env(TCLSH_CMD)]} { | 489 if {[info exists ::env(TCLSH_CMD)]} { |
458 set savedEnv(TCLSH_CMD) $::env(TCLSH_CMD) | 490 set savedEnv(TCLSH_CMD) $::env(TCLSH_CMD) |
459 } else { | 491 } else { |
460 unset -nocomplain savedEnv(TCLSH_CMD) | 492 unset -nocomplain savedEnv(TCLSH_CMD) |
461 } | 493 } |
462 set ::env(TCLSH_CMD) [file nativename [info nameofexecutable]] | 494 set ::env(TCLSH_CMD) [file nativename [info nameofexecutable]] |
463 set rc [catch [makeCommand $testtarget $makeOpts $cflags $opts]] | 495 set rc [catch [makeCommand $testtarget $makeOpts $cflags $opts]] |
464 if {[info exists savedEnv(TCLSH_CMD)]} { | 496 if {[info exists savedEnv(TCLSH_CMD)]} { |
465 set ::env(TCLSH_CMD) $savedEnv(TCLSH_CMD) | 497 set ::env(TCLSH_CMD) $savedEnv(TCLSH_CMD) |
466 } else { | 498 } else { |
467 unset -nocomplain ::env(TCLSH_CMD) | 499 unset -nocomplain ::env(TCLSH_CMD) |
468 } | 500 } |
469 } | 501 } |
470 | 502 |
| 503 # Clean up lots of extra files if --keep was not specified. |
| 504 if {$::KEEPFILES==0} { cleanup $normaldir } |
| 505 |
471 # Exis successfully if the test passed, or with a non-zero error code | 506 # Exis successfully if the test passed, or with a non-zero error code |
472 # otherwise. | 507 # otherwise. |
473 exit $rc | 508 exit $rc |
474 } | 509 } |
475 | 510 |
476 # This command is invoked in the master process each time a slave | 511 # This command is invoked in the master process each time a slave |
477 # file-descriptor is readable. | 512 # file-descriptor is readable. |
478 # | 513 # |
479 proc slave_fileevent {fd T tm1} { | 514 proc slave_fileevent {fd T tm1} { |
480 global G | 515 global G |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 } | 595 } |
561 | 596 |
562 # Run the job. | 597 # Run the job. |
563 # | 598 # |
564 set tm1 [clock seconds] | 599 set tm1 [clock seconds] |
565 incr G(nJob) | 600 incr G(nJob) |
566 set script [file normalize [info script]] | 601 set script [file normalize [info script]] |
567 set fd [open "|[info nameofexecutable] $script --slave" r+] | 602 set fd [open "|[info nameofexecutable] $script --slave" r+] |
568 fconfigure $fd -blocking 0 | 603 fconfigure $fd -blocking 0 |
569 fileevent $fd readable [list slave_fileevent $fd $T $tm1] | 604 fileevent $fd readable [list slave_fileevent $fd $T $tm1] |
570 puts $fd [list $::TRACE $::MSVC $::DRYRUN] | 605 puts $fd [list $::TRACE $::MSVC $::DRYRUN $::KEEPFILES] |
571 puts $fd [list {*}$T] | 606 puts $fd [list {*}$T] |
572 flush $fd | 607 flush $fd |
573 } | 608 } |
574 } | 609 } |
575 } | 610 } |
576 | 611 |
577 proc add_test_suite {listvar name testtarget config} { | 612 proc add_test_suite {listvar name testtarget config} { |
578 upvar $listvar alltests | 613 upvar $listvar alltests |
579 | 614 |
580 # Tcl variable $opts is used to build up the value used to set the | 615 # Tcl variable $opts is used to build up the value used to set the |
581 # OPTS Makefile variable. Variable $cflags holds the value for | 616 # OPTS Makefile variable. Variable $cflags holds the value for |
582 # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but | 617 # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but |
583 # CFLAGS is only passed to gcc. | 618 # CFLAGS is only passed to gcc. |
584 # | 619 # |
585 set makeOpts "" | 620 set makeOpts "" |
586 set cflags [expr {$::MSVC ? "-Zi" : "-g"}] | 621 set cflags [expr {$::MSVC ? "-Zi" : "-g"}] |
587 set opts "" | 622 set opts "" |
588 set title ${name}($testtarget) | 623 set title ${name}($testtarget) |
589 set configOpts $::WITHTCL | 624 set configOpts $::WITHTCL |
| 625 set skip 0 |
590 | 626 |
591 regsub -all {#[^\n]*\n} $config \n config | 627 regsub -all {#[^\n]*\n} $config \n config |
592 foreach arg $config { | 628 foreach arg $config { |
| 629 if {$skip} { |
| 630 set skip 0 |
| 631 continue |
| 632 } |
593 if {[regexp {^-[UD]} $arg]} { | 633 if {[regexp {^-[UD]} $arg]} { |
594 lappend opts $arg | 634 lappend opts $arg |
595 } elseif {[regexp {^[A-Z]+=} $arg]} { | 635 } elseif {[regexp {^[A-Z]+=} $arg]} { |
596 lappend testtarget $arg | 636 lappend testtarget $arg |
| 637 } elseif {[regexp {^if:([a-z]+)(.*)} $arg all key tail]} { |
| 638 # Arguments of the form 'if:os=="Linux"' will cause the subsequent |
| 639 # argument to be skipped if the $tcl_platform(os) is not "Linux", for |
| 640 # example... |
| 641 set skip [expr !(\$::tcl_platform($key)$tail)] |
597 } elseif {[regexp {^--(enable|disable)-} $arg]} { | 642 } elseif {[regexp {^--(enable|disable)-} $arg]} { |
598 if {$::MSVC} { | 643 if {$::MSVC} { |
599 if {$arg eq "--disable-amalgamation"} { | 644 if {$arg eq "--disable-amalgamation"} { |
600 lappend makeOpts USE_AMALGAMATION=0 | 645 lappend makeOpts USE_AMALGAMATION=0 |
601 continue | 646 continue |
602 } | 647 } |
603 if {$arg eq "--disable-shared"} { | 648 if {$arg eq "--disable-shared"} { |
604 lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0 | 649 lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0 |
605 continue | 650 continue |
606 } | 651 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 726 |
682 # The following procedure returns the "make" command to be executed for the | 727 # The following procedure returns the "make" command to be executed for the |
683 # specified targets, compiler flags, and options. | 728 # specified targets, compiler flags, and options. |
684 # | 729 # |
685 proc makeCommand { targets makeOpts cflags opts } { | 730 proc makeCommand { targets makeOpts cflags opts } { |
686 set result [list trace_cmd exec] | 731 set result [list trace_cmd exec] |
687 if {$::MSVC} { | 732 if {$::MSVC} { |
688 set nmakeDir [file nativename $::SRCDIR] | 733 set nmakeDir [file nativename $::SRCDIR] |
689 set nmakeFile [file nativename [file join $nmakeDir Makefile.msc]] | 734 set nmakeFile [file nativename [file join $nmakeDir Makefile.msc]] |
690 lappend result nmake /f $nmakeFile TOP=$nmakeDir | 735 lappend result nmake /f $nmakeFile TOP=$nmakeDir |
| 736 if {[regexp {USE_STDCALL=1} $cflags]} { |
| 737 lappend result USE_STDCALL=1 |
| 738 } |
691 } else { | 739 } else { |
692 lappend result make | 740 lappend result make |
693 } | 741 } |
694 foreach makeOpt $makeOpts { | 742 foreach makeOpt $makeOpts { |
695 lappend result $makeOpt | 743 lappend result $makeOpt |
696 } | 744 } |
697 lappend result clean | 745 lappend result clean |
698 foreach target $targets { | 746 foreach target $targets { |
699 lappend result $target | 747 lappend result $target |
700 } | 748 } |
(...skipping 24 matching lines...) Expand all Loading... |
725 proc process_options {argv} { | 773 proc process_options {argv} { |
726 set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] | 774 set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] |
727 set ::QUICK 0 | 775 set ::QUICK 0 |
728 set ::MSVC 0 | 776 set ::MSVC 0 |
729 set ::BUILDONLY 0 | 777 set ::BUILDONLY 0 |
730 set ::DRYRUN 0 | 778 set ::DRYRUN 0 |
731 set ::TRACE 0 | 779 set ::TRACE 0 |
732 set ::JOBS 1 | 780 set ::JOBS 1 |
733 set ::PROGRESS_MSGS 0 | 781 set ::PROGRESS_MSGS 0 |
734 set ::WITHTCL {} | 782 set ::WITHTCL {} |
| 783 set ::FORCE 0 |
| 784 set ::KEEPFILES 0 ;# Keep extra files after test run |
735 set config {} | 785 set config {} |
736 set platform $::tcl_platform(os)-$::tcl_platform(machine) | 786 set platform $::tcl_platform(os)-$::tcl_platform(machine) |
737 | 787 |
738 for {set i 0} {$i < [llength $argv]} {incr i} { | 788 for {set i 0} {$i < [llength $argv]} {incr i} { |
739 set x [lindex $argv $i] | 789 set x [lindex $argv $i] |
740 if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} | 790 if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} |
741 switch -glob -- $x { | 791 switch -glob -- $x { |
742 -slave { | 792 -slave { |
743 run_slave_test | 793 run_slave_test |
744 exit | 794 exit |
745 } | 795 } |
746 | 796 |
| 797 # Undocumented legacy option: --srcdir DIRECTORY |
| 798 # |
| 799 # DIRECTORY is the root of the SQLite checkout. This sets the |
| 800 # SRCDIR global variable. But that variable is already set |
| 801 # automatically so there really is no reason to have this option. |
| 802 # |
747 -srcdir { | 803 -srcdir { |
748 incr i | 804 incr i |
749 set ::SRCDIR [file normalize [lindex $argv $i]] | 805 set ::SRCDIR [file normalize [lindex $argv $i]] |
750 } | 806 } |
751 | 807 |
752 -platform { | 808 -platform { |
753 incr i | 809 incr i |
754 set platform [lindex $argv $i] | 810 set platform [lindex $argv $i] |
755 } | 811 } |
756 | 812 |
(...skipping 23 matching lines...) Expand all Loading... |
780 } | 836 } |
781 | 837 |
782 -buildonly { | 838 -buildonly { |
783 set ::BUILDONLY 1 | 839 set ::BUILDONLY 1 |
784 } | 840 } |
785 | 841 |
786 -dryrun { | 842 -dryrun { |
787 set ::DRYRUN 1 | 843 set ::DRYRUN 1 |
788 } | 844 } |
789 | 845 |
| 846 -force - |
| 847 -f { |
| 848 set ::FORCE 1 |
| 849 } |
| 850 |
790 -trace { | 851 -trace { |
791 set ::TRACE 1 | 852 set ::TRACE 1 |
792 } | 853 } |
793 | 854 |
794 -info { | 855 -info { |
795 PUTS "Command-line Options:" | 856 PUTS "Command-line Options:" |
796 PUTS " --srcdir $::SRCDIR" | 857 PUTS " --srcdir $::SRCDIR" |
797 PUTS " --platform [list $platform]" | 858 PUTS " --platform [list $platform]" |
798 PUTS " --config [list $config]" | 859 PUTS " --config [list $config]" |
799 if {$::QUICK} { | 860 if {$::QUICK} { |
(...skipping 12 matching lines...) Expand all Loading... |
812 foreach y [lsort [array names ::Configs]] { | 873 foreach y [lsort [array names ::Configs]] { |
813 PUTS " [list $y]" | 874 PUTS " [list $y]" |
814 } | 875 } |
815 exit | 876 exit |
816 } | 877 } |
817 | 878 |
818 -g { | 879 -g { |
819 lappend ::EXTRACONFIG [lindex $argv $i] | 880 lappend ::EXTRACONFIG [lindex $argv $i] |
820 } | 881 } |
821 | 882 |
| 883 -keep { |
| 884 set ::KEEPFILES 1 |
| 885 } |
| 886 |
822 -with-tcl=* { | 887 -with-tcl=* { |
823 set ::WITHTCL -$x | 888 set ::WITHTCL -$x |
824 } | 889 } |
825 | 890 |
826 -D* - | 891 -D* - |
827 -O* - | 892 -O* - |
828 -enable-* - | 893 -enable-* - |
829 -disable-* - | 894 -disable-* - |
830 *=* { | 895 *=* { |
831 lappend ::EXTRACONFIG [lindex $argv $i] | 896 lappend ::EXTRACONFIG [lindex $argv $i] |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 if {$::BUILDONLY} {PUTSNNL " --buildonly"} | 938 if {$::BUILDONLY} {PUTSNNL " --buildonly"} |
874 if {$::MSVC} {PUTSNNL " --msvc"} | 939 if {$::MSVC} {PUTSNNL " --msvc"} |
875 switch -- $::QUICK { | 940 switch -- $::QUICK { |
876 1 {PUTSNNL " --quick"} | 941 1 {PUTSNNL " --quick"} |
877 2 {PUTSNNL " --veryquick"} | 942 2 {PUTSNNL " --veryquick"} |
878 } | 943 } |
879 if {$::JOBS>1} {PUTSNNL " --jobs $::JOBS"} | 944 if {$::JOBS>1} {PUTSNNL " --jobs $::JOBS"} |
880 PUTS "" | 945 PUTS "" |
881 } | 946 } |
882 | 947 |
| 948 # Check to see if there are uncommitted changes in the SQLite source |
| 949 # checkout. Exit if there are. Except: Do nothing if the --force |
| 950 # flag is used. Also, ignore this test if the fossil binary is |
| 951 # unavailable, or if the source tree is not a valid fossil checkout. |
| 952 # |
| 953 proc check_uncommitted {} { |
| 954 if {$::FORCE} return |
| 955 set pwd [pwd] |
| 956 cd $::SRCDIR |
| 957 if {[catch {exec fossil changes} res]==0 && [string trim $res]!=""} { |
| 958 puts "ERROR: The check-out contains uncommitted changes:" |
| 959 puts $res |
| 960 puts "Use the -f or --force options to override" |
| 961 exit 1 |
| 962 } |
| 963 cd $pwd |
| 964 } |
| 965 |
| 966 # A test run has just finished in directory $dir. This command deletes all |
| 967 # non-essential files from the directory. Specifically, everything except |
| 968 # |
| 969 # * The "testfixture" and "sqlite3" binaries, |
| 970 # * The "test-out.log" and "test.log" log files. |
| 971 # |
| 972 proc cleanup {dir} { |
| 973 set K(testfixture) 1 |
| 974 set K(testfixture.exe) 1 |
| 975 set K(sqlite3) 1 |
| 976 set K(sqlite3.exe) 1 |
| 977 set K(test-out.txt) 1 |
| 978 set K(test.log) 1 |
| 979 |
| 980 foreach f [glob -nocomplain [file join $dir *]] { |
| 981 set tail [file tail $f] |
| 982 if {[info exists K($tail)]==0} { |
| 983 file delete -force $f |
| 984 } |
| 985 } |
| 986 } |
| 987 |
| 988 |
883 # Main routine. | 989 # Main routine. |
884 # | 990 # |
885 proc main {argv} { | 991 proc main {argv} { |
886 | 992 |
887 # Process any command line options. | 993 # Process any command line options. |
888 set ::EXTRACONFIG {} | 994 set ::EXTRACONFIG {} |
889 process_options $argv | 995 process_options $argv |
| 996 if {!$::DRYRUN} check_uncommitted |
890 PUTS [string repeat * 79] | 997 PUTS [string repeat * 79] |
891 | 998 |
892 set ::NERR 0 | 999 set ::NERR 0 |
893 set ::NTEST 0 | 1000 set ::NTEST 0 |
894 set ::NTESTCASE 0 | 1001 set ::NTESTCASE 0 |
895 set ::NERRCASE 0 | 1002 set ::NERRCASE 0 |
896 set ::SQLITE_VERSION {} | 1003 set ::SQLITE_VERSION {} |
897 set STARTTIME [clock seconds] | 1004 set STARTTIME [clock seconds] |
898 foreach {zConfig target} $::CONFIGLIST { | 1005 foreach {zConfig target} $::CONFIGLIST { |
899 if {$::MSVC && ($zConfig eq "Sanitize" || "checksymbols" in $target | 1006 if {$::MSVC && ($zConfig eq "Sanitize" || "checksymbols" in $target |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 if {[catch {exec hostname} HNAME]==0} {append etime " on $HNAME"} | 1058 if {[catch {exec hostname} HNAME]==0} {append etime " on $HNAME"} |
952 PUTS [string repeat * 79] | 1059 PUTS [string repeat * 79] |
953 incr ::NERRCASE $::NERR | 1060 incr ::NERRCASE $::NERR |
954 PUTS "$::NERRCASE failures out of $::NTESTCASE tests in $etime" | 1061 PUTS "$::NERRCASE failures out of $::NTESTCASE tests in $etime" |
955 if {$::SQLITE_VERSION ne ""} { | 1062 if {$::SQLITE_VERSION ne ""} { |
956 PUTS "SQLite $::SQLITE_VERSION" | 1063 PUTS "SQLite $::SQLITE_VERSION" |
957 } | 1064 } |
958 } | 1065 } |
959 | 1066 |
960 main $argv | 1067 main $argv |
OLD | NEW |