drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 1 | #!/usr/bin/tclsh |
| 2 | # |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 3 | # Documentation for this script. This may be output to stderr |
| 4 | # if the script is invoked incorrectly. See the [process_options] |
| 5 | # proc below. |
| 6 | # |
| 7 | set ::USAGE_MESSAGE { |
| 8 | This Tcl script is used to test the various configurations required |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 9 | before releasing a new version. Supported command line options (all |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 10 | optional) are: |
| 11 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 12 | --srcdir TOP-OF-SQLITE-TREE (see below) |
| 13 | --platform PLATFORM (see below) |
| 14 | --config CONFIGNAME (Run only CONFIGNAME) |
| 15 | --quick (Run "veryquick.test" only) |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 16 | --veryquick (Run "make smoketest" only) |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 17 | --msvc (Use MSVC as the compiler) |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 18 | --buildonly (Just build testfixture - do not run) |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 19 | --dryrun (Print what would have happened) |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 20 | --info (Show diagnostic info) |
drh | 0ef84d0 | 2015-04-24 17:50:37 +0000 | [diff] [blame] | 21 | --with-tcl=DIR (Use TCL build at DIR) |
dan | e9e1505 | 2015-11-02 20:28:48 +0000 | [diff] [blame] | 22 | --jobs N (Use N processes - default 1) |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 23 | --progress (Show progress messages) |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 24 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 25 | The default value for --srcdir is the parent of the directory holding |
| 26 | this script. |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 27 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 28 | The script determines the default value for --platform using the |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 29 | $tcl_platform(os) and $tcl_platform(machine) variables. Supported |
| 30 | platforms are "Linux-x86", "Linux-x86_64", "Darwin-i386", |
| 31 | "Darwin-x86_64", "Windows NT-intel", and "Windows NT-amd64". |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 32 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 33 | Every test begins with a fresh run of the configure script at the top |
| 34 | of the SQLite source tree. |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 35 | } |
| 36 | |
drh | 4380ff8 | 2015-11-03 15:16:21 +0000 | [diff] [blame] | 37 | # Return a timestamp of the form HH:MM:SS |
| 38 | # |
| 39 | proc now {} { |
| 40 | return [clock format [clock seconds] -format %H:%M:%S] |
| 41 | } |
| 42 | |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 43 | # Omit comments (text between # and \n) in a long multi-line string. |
| 44 | # |
| 45 | proc strip_comments {in} { |
| 46 | regsub -all {#[^\n]*\n} $in {} out |
| 47 | return $out |
| 48 | } |
| 49 | |
| 50 | array set ::Configs [strip_comments { |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 51 | "Default" { |
| 52 | -O2 |
drh | edb31cd | 2015-01-08 02:15:11 +0000 | [diff] [blame] | 53 | --disable-amalgamation --disable-shared |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 54 | } |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 55 | "Sanitize" { |
drh | 149735d | 2015-01-01 19:53:10 +0000 | [diff] [blame] | 56 | CC=clang -fsanitize=undefined |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 57 | -DSQLITE_ENABLE_STAT4 |
dan | 5608973 | 2011-04-06 12:37:09 +0000 | [diff] [blame] | 58 | } |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 59 | "Have-Not" { |
| 60 | # The "Have-Not" configuration sets all possible -UHAVE_feature options |
| 61 | # in order to verify that the code works even on platforms that lack |
| 62 | # these support services. |
| 63 | -DHAVE_FDATASYNC=0 |
| 64 | -DHAVE_GMTIME_R=0 |
drh | 8567d40 | 2015-01-10 18:22:06 +0000 | [diff] [blame] | 65 | -DHAVE_ISNAN=0 |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 66 | -DHAVE_LOCALTIME_R=0 |
| 67 | -DHAVE_LOCALTIME_S=0 |
| 68 | -DHAVE_MALLOC_USABLE_SIZE=0 |
| 69 | -DHAVE_STRCHRNUL=0 |
| 70 | -DHAVE_USLEEP=0 |
| 71 | -DHAVE_UTIME=0 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 72 | } |
| 73 | "Unlock-Notify" { |
| 74 | -O2 |
| 75 | -DSQLITE_ENABLE_UNLOCK_NOTIFY |
| 76 | -DSQLITE_THREADSAFE |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 77 | -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 |
| 78 | } |
| 79 | "Secure-Delete" { |
| 80 | -O2 |
| 81 | -DSQLITE_SECURE_DELETE=1 |
| 82 | -DSQLITE_SOUNDEX=1 |
| 83 | } |
| 84 | "Update-Delete-Limit" { |
| 85 | -O2 |
| 86 | -DSQLITE_DEFAULT_FILE_FORMAT=4 |
| 87 | -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 |
drh | 1a80384 | 2015-01-09 20:00:21 +0000 | [diff] [blame] | 88 | -DSQLITE_ENABLE_STMT_SCANSTATUS |
drh | 7f10579 | 2016-01-04 01:08:50 +0000 | [diff] [blame] | 89 | -DSQLITE_LIKE_DOESNT_MATCH_BLOBS |
| 90 | -DSQLITE_ENABLE_CURSOR_HINTS |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 91 | --enable-json1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 92 | } |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 93 | "Check-Symbols" { |
| 94 | -DSQLITE_MEMDEBUG=1 |
| 95 | -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 |
| 96 | -DSQLITE_ENABLE_FTS3=1 |
| 97 | -DSQLITE_ENABLE_RTREE=1 |
| 98 | -DSQLITE_ENABLE_MEMSYS5=1 |
| 99 | -DSQLITE_ENABLE_MEMSYS3=1 |
| 100 | -DSQLITE_ENABLE_COLUMN_METADATA=1 |
| 101 | -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 |
| 102 | -DSQLITE_SECURE_DELETE=1 |
| 103 | -DSQLITE_SOUNDEX=1 |
| 104 | -DSQLITE_ENABLE_ATOMIC_WRITE=1 |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 105 | -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 |
| 106 | -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 107 | -DSQLITE_ENABLE_STAT4 |
drh | 1a80384 | 2015-01-09 20:00:21 +0000 | [diff] [blame] | 108 | -DSQLITE_ENABLE_STMT_SCANSTATUS |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 109 | --enable-json1 --enable-fts5 |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 110 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 111 | "Debug-One" { |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 112 | --disable-shared |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 113 | -O2 |
| 114 | -DSQLITE_DEBUG=1 |
| 115 | -DSQLITE_MEMDEBUG=1 |
| 116 | -DSQLITE_MUTEX_NOOP=1 |
| 117 | -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 |
| 118 | -DSQLITE_ENABLE_FTS3=1 |
| 119 | -DSQLITE_ENABLE_RTREE=1 |
| 120 | -DSQLITE_ENABLE_MEMSYS5=1 |
| 121 | -DSQLITE_ENABLE_MEMSYS3=1 |
| 122 | -DSQLITE_ENABLE_COLUMN_METADATA=1 |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 123 | -DSQLITE_ENABLE_STAT4 |
drh | 03d69a6 | 2015-11-19 13:53:57 +0000 | [diff] [blame] | 124 | -DSQLITE_ENABLE_HIDDEN_COLUMNS |
drh | edb31cd | 2015-01-08 02:15:11 +0000 | [diff] [blame] | 125 | -DSQLITE_MAX_ATTACHED=125 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 126 | } |
drh | f332071 | 2015-04-25 13:39:29 +0000 | [diff] [blame] | 127 | "Fast-One" { |
| 128 | -O6 |
| 129 | -DSQLITE_ENABLE_FTS4=1 |
| 130 | -DSQLITE_ENABLE_RTREE=1 |
| 131 | -DSQLITE_ENABLE_STAT4 |
drh | cfb8f8d | 2015-07-23 20:44:49 +0000 | [diff] [blame] | 132 | -DSQLITE_ENABLE_RBU |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 133 | -DSQLITE_MAX_ATTACHED=125 |
drh | 51675f2 | 2015-11-06 20:04:08 +0000 | [diff] [blame] | 134 | -DLONGDOUBLE_TYPE=double |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 135 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 136 | "Device-One" { |
| 137 | -O2 |
| 138 | -DSQLITE_DEBUG=1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 139 | -DSQLITE_DEFAULT_AUTOVACUUM=1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 140 | -DSQLITE_DEFAULT_CACHE_SIZE=64 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 141 | -DSQLITE_DEFAULT_PAGE_SIZE=1024 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 142 | -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=32 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 143 | -DSQLITE_DISABLE_LFS=1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 144 | -DSQLITE_ENABLE_ATOMIC_WRITE=1 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 145 | -DSQLITE_ENABLE_IOTRACE=1 |
| 146 | -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 |
| 147 | -DSQLITE_MAX_PAGE_SIZE=4096 |
| 148 | -DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 149 | -DSQLITE_OMIT_PROGRESS_CALLBACK=1 |
| 150 | -DSQLITE_OMIT_VIRTUALTABLE=1 |
drh | 03d69a6 | 2015-11-19 13:53:57 +0000 | [diff] [blame] | 151 | -DSQLITE_ENABLE_HIDDEN_COLUMNS |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 152 | -DSQLITE_TEMP_STORE=3 |
drh | 64db184 | 2015-10-09 13:29:27 +0000 | [diff] [blame] | 153 | --enable-json1 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 154 | } |
| 155 | "Device-Two" { |
| 156 | -DSQLITE_4_BYTE_ALIGNED_MALLOC=1 |
| 157 | -DSQLITE_DEFAULT_AUTOVACUUM=1 |
| 158 | -DSQLITE_DEFAULT_CACHE_SIZE=1000 |
| 159 | -DSQLITE_DEFAULT_LOCKING_MODE=0 |
| 160 | -DSQLITE_DEFAULT_PAGE_SIZE=1024 |
| 161 | -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=1000 |
| 162 | -DSQLITE_DISABLE_LFS=1 |
| 163 | -DSQLITE_ENABLE_FTS3=1 |
| 164 | -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 |
| 165 | -DSQLITE_ENABLE_RTREE=1 |
| 166 | -DSQLITE_MAX_COMPOUND_SELECT=50 |
| 167 | -DSQLITE_MAX_PAGE_SIZE=32768 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 168 | -DSQLITE_OMIT_TRACE=1 |
| 169 | -DSQLITE_TEMP_STORE=3 |
| 170 | -DSQLITE_THREADSAFE=2 |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 171 | --enable-json1 --enable-fts5 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 172 | } |
| 173 | "Locking-Style" { |
| 174 | -O2 |
| 175 | -DSQLITE_ENABLE_LOCKING_STYLE=1 |
| 176 | } |
| 177 | "OS-X" { |
drh | 149735d | 2015-01-01 19:53:10 +0000 | [diff] [blame] | 178 | -O1 # Avoid a compiler bug in gcc 4.2.1 build 5658 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 179 | -DSQLITE_OMIT_LOAD_EXTENSION=1 |
| 180 | -DSQLITE_DEFAULT_MEMSTATUS=0 |
| 181 | -DSQLITE_THREADSAFE=2 |
| 182 | -DSQLITE_OS_UNIX=1 |
drh | c306e08 | 2015-10-08 23:37:00 +0000 | [diff] [blame] | 183 | -DSQLITE_ENABLE_JSON1=1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 184 | -DSQLITE_ENABLE_LOCKING_STYLE=1 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 185 | -DUSE_PREAD=1 |
| 186 | -DSQLITE_ENABLE_RTREE=1 |
| 187 | -DSQLITE_ENABLE_FTS3=1 |
| 188 | -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 |
| 189 | -DSQLITE_DEFAULT_CACHE_SIZE=1000 |
| 190 | -DSQLITE_MAX_LENGTH=2147483645 |
| 191 | -DSQLITE_MAX_VARIABLE_NUMBER=500000 |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 192 | -DSQLITE_DEBUG=1 |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 193 | -DSQLITE_PREFER_PROXY_LOCKING=1 |
drh | c67d650 | 2014-12-31 15:14:29 +0000 | [diff] [blame] | 194 | -DSQLITE_ENABLE_API_ARMOR=1 |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 195 | --enable-json1 --enable-fts5 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 196 | } |
| 197 | "Extra-Robustness" { |
| 198 | -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 |
dan | 5608973 | 2011-04-06 12:37:09 +0000 | [diff] [blame] | 199 | -DSQLITE_MAX_ATTACHED=62 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 200 | } |
dan | 4dc3d73 | 2012-08-20 17:24:48 +0000 | [diff] [blame] | 201 | "Devkit" { |
| 202 | -DSQLITE_DEFAULT_FILE_FORMAT=4 |
| 203 | -DSQLITE_MAX_ATTACHED=30 |
| 204 | -DSQLITE_ENABLE_COLUMN_METADATA |
| 205 | -DSQLITE_ENABLE_FTS4 |
dan | e82126c | 2016-03-01 16:02:57 +0000 | [diff] [blame] | 206 | -DSQLITE_ENABLE_FTS5 |
dan | 4dc3d73 | 2012-08-20 17:24:48 +0000 | [diff] [blame] | 207 | -DSQLITE_ENABLE_FTS4_PARENTHESIS |
| 208 | -DSQLITE_DISABLE_FTS4_DEFERRED |
| 209 | -DSQLITE_ENABLE_RTREE |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 210 | --enable-json1 --enable-fts5 |
dan | 4dc3d73 | 2012-08-20 17:24:48 +0000 | [diff] [blame] | 211 | } |
dan | d79d27a | 2014-08-12 14:06:13 +0000 | [diff] [blame] | 212 | "No-lookaside" { |
| 213 | -DSQLITE_TEST_REALLOC_STRESS=1 |
| 214 | -DSQLITE_OMIT_LOOKASIDE=1 |
| 215 | -DHAVE_USLEEP=1 |
| 216 | } |
drh | 8a2a0f5 | 2015-01-07 14:09:41 +0000 | [diff] [blame] | 217 | "Valgrind" { |
| 218 | -DSQLITE_ENABLE_STAT4 |
| 219 | -DSQLITE_ENABLE_FTS4 |
| 220 | -DSQLITE_ENABLE_RTREE |
drh | 03d69a6 | 2015-11-19 13:53:57 +0000 | [diff] [blame] | 221 | -DSQLITE_ENABLE_HIDDEN_COLUMNS |
drh | ce1d9f5 | 2015-10-09 12:48:33 +0000 | [diff] [blame] | 222 | --enable-json1 |
drh | 8a2a0f5 | 2015-01-07 14:09:41 +0000 | [diff] [blame] | 223 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 224 | |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 225 | # The next group of configurations are used only by the |
| 226 | # Failure-Detection platform. They are all the same, but we need |
| 227 | # different names for them all so that they results appear in separate |
| 228 | # subdirectories. |
| 229 | # |
drh | edb31cd | 2015-01-08 02:15:11 +0000 | [diff] [blame] | 230 | Fail0 {-O0} |
| 231 | Fail2 {-O0} |
| 232 | Fail3 {-O0} |
drh | db6bafa | 2015-01-09 21:54:58 +0000 | [diff] [blame] | 233 | Fail4 {-O0} |
drh | 8ea5eca | 2015-04-24 16:53:03 +0000 | [diff] [blame] | 234 | FuzzFail1 {-O0} |
| 235 | FuzzFail2 {-O0} |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 236 | }] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 237 | |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 238 | array set ::Platforms [strip_comments { |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 239 | Linux-x86_64 { |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 240 | "Check-Symbols" checksymbols |
drh | 71258ab | 2015-11-04 16:34:58 +0000 | [diff] [blame] | 241 | "Fast-One" fuzztest |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 242 | "Debug-One" "mptest test" |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 243 | "Have-Not" test |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 244 | "Secure-Delete" test |
| 245 | "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 246 | "Update-Delete-Limit" test |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 247 | "Extra-Robustness" test |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 248 | "Device-Two" test |
dan | d79d27a | 2014-08-12 14:06:13 +0000 | [diff] [blame] | 249 | "No-lookaside" test |
dan | 5d510d4 | 2014-10-15 15:28:27 +0000 | [diff] [blame] | 250 | "Devkit" test |
drh | 8a2a0f5 | 2015-01-07 14:09:41 +0000 | [diff] [blame] | 251 | "Sanitize" {QUICKTEST_OMIT=func4.test,nan.test test} |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 252 | "Device-One" fulltest |
drh | 71258ab | 2015-11-04 16:34:58 +0000 | [diff] [blame] | 253 | "Default" "threadtest fulltest" |
| 254 | "Valgrind" valgrindtest |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 255 | } |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 256 | Linux-i686 { |
dan | 4dc3d73 | 2012-08-20 17:24:48 +0000 | [diff] [blame] | 257 | "Devkit" test |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 258 | "Have-Not" test |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 259 | "Unlock-Notify" "QUICKTEST_INCLUDE=notify2.test test" |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 260 | "Device-One" test |
dan | d38bc1b | 2010-09-13 12:15:36 +0000 | [diff] [blame] | 261 | "Device-Two" test |
| 262 | "Default" "threadtest fulltest" |
dan | 1c22a18 | 2010-09-13 11:29:02 +0000 | [diff] [blame] | 263 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 264 | Darwin-i386 { |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 265 | "Locking-Style" "mptest test" |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 266 | "Have-Not" test |
dan | d38bc1b | 2010-09-13 12:15:36 +0000 | [diff] [blame] | 267 | "OS-X" "threadtest fulltest" |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 268 | } |
drh | bcbac68 | 2014-12-31 18:55:09 +0000 | [diff] [blame] | 269 | Darwin-x86_64 { |
| 270 | "Locking-Style" "mptest test" |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 271 | "Have-Not" test |
drh | bcbac68 | 2014-12-31 18:55:09 +0000 | [diff] [blame] | 272 | "OS-X" "threadtest fulltest" |
| 273 | } |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 274 | "Windows NT-intel" { |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 275 | "Have-Not" test |
drh | 71258ab | 2015-11-04 16:34:58 +0000 | [diff] [blame] | 276 | "Default" "mptest fulltestonly" |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 277 | } |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 278 | "Windows NT-amd64" { |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 279 | "Have-Not" test |
drh | 71258ab | 2015-11-04 16:34:58 +0000 | [diff] [blame] | 280 | "Default" "mptest fulltestonly" |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 281 | } |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 282 | |
| 283 | # The Failure-Detection platform runs various tests that deliberately |
| 284 | # fail. This is used as a test of this script to verify that this script |
| 285 | # correctly identifies failures. |
| 286 | # |
drh | edb31cd | 2015-01-08 02:15:11 +0000 | [diff] [blame] | 287 | Failure-Detection { |
| 288 | Fail0 "TEST_FAILURE=0 test" |
| 289 | Sanitize "TEST_FAILURE=1 test" |
| 290 | Fail2 "TEST_FAILURE=2 valgrindtest" |
| 291 | Fail3 "TEST_FAILURE=3 valgrindtest" |
drh | db6bafa | 2015-01-09 21:54:58 +0000 | [diff] [blame] | 292 | Fail4 "TEST_FAILURE=4 test" |
drh | 8ea5eca | 2015-04-24 16:53:03 +0000 | [diff] [blame] | 293 | FuzzFail1 "TEST_FAILURE=5 test" |
| 294 | FuzzFail2 "TEST_FAILURE=5 valgrindtest" |
drh | edb31cd | 2015-01-08 02:15:11 +0000 | [diff] [blame] | 295 | } |
drh | 6aed1c4 | 2015-01-10 15:21:26 +0000 | [diff] [blame] | 296 | }] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 297 | |
dan | e7152dc | 2011-07-07 08:19:16 +0000 | [diff] [blame] | 298 | |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 299 | # End of configuration section. |
| 300 | ######################################################################### |
| 301 | ######################################################################### |
| 302 | |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 303 | # Configuration verification: Check that each entry in the list of configs |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 304 | # specified for each platforms exists. |
| 305 | # |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 306 | foreach {key value} [array get ::Platforms] { |
| 307 | foreach {v t} $value { |
| 308 | if {0==[info exists ::Configs($v)]} { |
| 309 | puts stderr "No such configuration: \"$v\"" |
| 310 | exit -1 |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 315 | # Output log. Disabled for slave interpreters. |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 316 | # |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 317 | if {[lindex $argv end]!="--slave"} { |
| 318 | set LOG [open releasetest-out.txt w] |
| 319 | proc PUTS {txt} { |
| 320 | puts $txt |
| 321 | puts $::LOG $txt |
| 322 | flush $::LOG |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 323 | } |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 324 | proc PUTSNNL {txt} { |
| 325 | puts -nonewline $txt |
| 326 | puts -nonewline $::LOG $txt |
| 327 | flush $::LOG |
| 328 | } |
| 329 | proc PUTSERR {txt} { |
| 330 | puts stderr $txt |
| 331 | puts $::LOG $txt |
| 332 | flush $::LOG |
| 333 | } |
| 334 | puts $LOG "$argv0 $argv" |
| 335 | set tm0 [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S} -gmt 1] |
| 336 | puts $LOG "start-time: $tm0 UTC" |
| 337 | } else { |
| 338 | proc PUTS {txt} { |
| 339 | puts $txt |
| 340 | } |
| 341 | proc PUTSNNL {txt} { |
| 342 | puts -nonewline $txt |
| 343 | } |
| 344 | proc PUTSERR {txt} { |
| 345 | puts stderr $txt |
| 346 | } |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 347 | } |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 348 | |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 349 | # Open the file $logfile and look for a report on the number of errors |
| 350 | # and the number of test cases run. Add these values to the global |
| 351 | # $::NERRCASE and $::NTESTCASE variables. |
| 352 | # |
| 353 | # If any errors occur, then write into $errmsgVar the text of an appropriate |
| 354 | # one-line error message to show on the output. |
| 355 | # |
| 356 | proc count_tests_and_errors {logfile rcVar errmsgVar} { |
drh | cb281a9 | 2014-12-29 19:54:10 +0000 | [diff] [blame] | 357 | if {$::DRYRUN} return |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 358 | upvar 1 $rcVar rc $errmsgVar errmsg |
| 359 | set fd [open $logfile rb] |
| 360 | set seen 0 |
| 361 | while {![eof $fd]} { |
| 362 | set line [gets $fd] |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 363 | if {[regexp {(\d+) errors out of (\d+) tests} $line all nerr ntest]} { |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 364 | incr ::NERRCASE $nerr |
| 365 | incr ::NTESTCASE $ntest |
| 366 | set seen 1 |
| 367 | if {$nerr>0} { |
| 368 | set rc 1 |
| 369 | set errmsg $line |
| 370 | } |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 371 | } |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 372 | if {[regexp {runtime error: +(.*)} $line all msg]} { |
drh | 36c25f7 | 2015-07-29 20:24:39 +0000 | [diff] [blame] | 373 | # skip over "value is outside range" errors |
| 374 | if {[regexp {value .* is outside the range of representable} $line]} { |
| 375 | # noop |
| 376 | } else { |
| 377 | incr ::NERRCASE |
| 378 | if {$rc==0} { |
| 379 | set rc 1 |
| 380 | set errmsg $msg |
| 381 | } |
drh | 4081d5d | 2015-01-01 23:02:01 +0000 | [diff] [blame] | 382 | } |
| 383 | } |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 384 | if {[regexp {fatal error +(.*)} $line all msg]} { |
| 385 | incr ::NERRCASE |
| 386 | if {$rc==0} { |
| 387 | set rc 1 |
| 388 | set errmsg $msg |
| 389 | } |
| 390 | } |
drh | 8a2a0f5 | 2015-01-07 14:09:41 +0000 | [diff] [blame] | 391 | if {[regexp {ERROR SUMMARY: (\d+) errors.*} $line all cnt] && $cnt>0} { |
| 392 | incr ::NERRCASE |
| 393 | if {$rc==0} { |
| 394 | set rc 1 |
| 395 | set errmsg $all |
| 396 | } |
| 397 | } |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 398 | if {[regexp {^VERSION: 3\.\d+.\d+} $line]} { |
| 399 | set v [string range $line 9 end] |
| 400 | if {$::SQLITE_VERSION eq ""} { |
| 401 | set ::SQLITE_VERSION $v |
| 402 | } elseif {$::SQLITE_VERSION ne $v} { |
| 403 | set rc 1 |
| 404 | set errmsg "version conflict: {$::SQLITE_VERSION} vs. {$v}" |
| 405 | } |
| 406 | } |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 407 | } |
| 408 | close $fd |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 409 | if {$::BUILDONLY} { |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 410 | incr ::NTESTCASE |
| 411 | if {$rc!=0} { |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 412 | set errmsg "Build failed" |
| 413 | } |
| 414 | } elseif {!$seen} { |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 415 | set rc 1 |
| 416 | set errmsg "Test did not complete" |
drh | db6bafa | 2015-01-09 21:54:58 +0000 | [diff] [blame] | 417 | if {[file readable core]} { |
| 418 | append errmsg " - core file exists" |
| 419 | } |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 420 | } |
| 421 | } |
| 422 | |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 423 | #-------------------------------------------------------------------------- |
| 424 | # This command is invoked as the [main] routine for scripts run with the |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 425 | # "--slave" option. |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 426 | # |
| 427 | # For each test (i.e. "configure && make test" execution), the master |
| 428 | # process spawns a process with the --slave option. It writes two lines |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 429 | # to the slaves stdin. The first contains a single boolean value - the |
| 430 | # value of ::TRACE to use in the slave script. The second line contains a |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 431 | # list in the same format as each element of the list passed to the |
| 432 | # [run_all_test_suites] command in the master process. |
| 433 | # |
| 434 | # The slave then runs the "configure && make test" commands specified. It |
| 435 | # exits successfully if the tests passes, or with a non-zero error code |
| 436 | # otherwise. |
| 437 | # |
| 438 | proc run_slave_test {} { |
| 439 | # Read global vars configuration from stdin. |
| 440 | set V [gets stdin] |
dan | d08a63a | 2015-11-02 20:52:20 +0000 | [diff] [blame] | 441 | foreach {::TRACE ::MSVC ::DRYRUN} $V {} |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 442 | |
| 443 | # Read the test-suite configuration from stdin. |
| 444 | set T [gets stdin] |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 445 | foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 446 | |
| 447 | # Create and switch to the test directory. |
drh | 6653fbe | 2015-11-13 20:52:49 +0000 | [diff] [blame] | 448 | set ::env(SQLITE_TMPDIR) [file normalize $dir] |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 449 | trace_cmd file mkdir $dir |
| 450 | trace_cmd cd $dir |
| 451 | catch {file delete core} |
| 452 | catch {file delete test.log} |
| 453 | |
| 454 | # Run the "./configure && make" commands. |
| 455 | set rc 0 |
| 456 | set rc [catch [configureCommand $configOpts]] |
| 457 | if {!$rc} { |
mistachkin | 5918943 | 2015-11-02 21:05:56 +0000 | [diff] [blame] | 458 | if {[info exists ::env(TCLSH_CMD)]} { |
| 459 | set savedEnv(TCLSH_CMD) $::env(TCLSH_CMD) |
| 460 | } else { |
| 461 | unset -nocomplain savedEnv(TCLSH_CMD) |
| 462 | } |
| 463 | set ::env(TCLSH_CMD) [file nativename [info nameofexecutable]] |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 464 | set rc [catch [makeCommand $testtarget $makeOpts $cflags $opts]] |
mistachkin | 5918943 | 2015-11-02 21:05:56 +0000 | [diff] [blame] | 465 | if {[info exists savedEnv(TCLSH_CMD)]} { |
| 466 | set ::env(TCLSH_CMD) $savedEnv(TCLSH_CMD) |
| 467 | } else { |
| 468 | unset -nocomplain ::env(TCLSH_CMD) |
| 469 | } |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 470 | } |
| 471 | |
| 472 | # Exis successfully if the test passed, or with a non-zero error code |
| 473 | # otherwise. |
| 474 | exit $rc |
| 475 | } |
| 476 | |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 477 | # This command is invoked in the master process each time a slave |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 478 | # file-descriptor is readable. |
| 479 | # |
| 480 | proc slave_fileevent {fd T tm1} { |
| 481 | global G |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 482 | foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 483 | |
| 484 | if {[eof $fd]} { |
| 485 | fconfigure $fd -blocking 1 |
| 486 | set rc [catch { close $fd }] |
| 487 | |
| 488 | set errmsg {} |
dan | e9e1505 | 2015-11-02 20:28:48 +0000 | [diff] [blame] | 489 | set logfile [file join $dir test.log] |
| 490 | if {[file exists $logfile]} { |
| 491 | count_tests_and_errors [file join $dir test.log] rc errmsg |
drh | 4380ff8 | 2015-11-03 15:16:21 +0000 | [diff] [blame] | 492 | } elseif {$rc==0 && !$::DRYRUN} { |
dan | e9e1505 | 2015-11-02 20:28:48 +0000 | [diff] [blame] | 493 | set rc 1 |
| 494 | set errmsg "no test.log file..." |
| 495 | } |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 496 | |
| 497 | if {!$::TRACE} { |
| 498 | set tm2 [clock seconds] |
| 499 | set hours [expr {($tm2-$tm1)/3600}] |
| 500 | set minutes [expr {(($tm2-$tm1)/60)%60}] |
| 501 | set seconds [expr {($tm2-$tm1)%60}] |
| 502 | set tm [format (%02d:%02d:%02d) $hours $minutes $seconds] |
| 503 | |
| 504 | if {$rc} { |
| 505 | set status FAIL |
| 506 | incr ::NERR |
| 507 | } else { |
| 508 | set status Ok |
| 509 | } |
| 510 | |
| 511 | set n [string length $title] |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 512 | if {$::PROGRESS_MSGS} { |
| 513 | PUTS "finished: ${title}[string repeat . [expr {53-$n}]] $status $tm" |
| 514 | } else { |
| 515 | PUTS "${title}[string repeat . [expr {63-$n}]] $status $tm" |
| 516 | } |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 517 | if {$errmsg!=""} {PUTS " $errmsg"} |
| 518 | flush stdout |
| 519 | } |
| 520 | |
| 521 | incr G(nJob) -1 |
| 522 | } else { |
| 523 | set line [gets $fd] |
| 524 | if {[string trim $line] != ""} { |
| 525 | puts "Trace : $title - \"$line\"" |
| 526 | } |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | #-------------------------------------------------------------------------- |
| 531 | # The only argument passed to this function is a list of test-suites to |
| 532 | # run. Each "test-suite" is itself a list consisting of the following |
| 533 | # elements: |
| 534 | # |
| 535 | # * Test title (for display). |
| 536 | # * The name of the directory to run the test in. |
| 537 | # * The argument for [configureCommand] |
| 538 | # * The first argument for [makeCommand] |
| 539 | # * The second argument for [makeCommand] |
| 540 | # * The third argument for [makeCommand] |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 541 | # |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 542 | proc run_all_test_suites {alltests} { |
| 543 | global G |
| 544 | set tests $alltests |
| 545 | |
| 546 | set G(nJob) 0 |
| 547 | |
| 548 | while {[llength $tests]>0 || $G(nJob)>0} { |
| 549 | if {$G(nJob)>=$::JOBS || [llength $tests]==0} { |
| 550 | vwait G(nJob) |
| 551 | } |
| 552 | |
| 553 | if {[llength $tests]>0} { |
| 554 | set T [lindex $tests 0] |
| 555 | set tests [lrange $tests 1 end] |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 556 | foreach {title dir configOpts testtarget makeOpts cflags opts} $T {} |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 557 | if {$::PROGRESS_MSGS && !$::TRACE} { |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 558 | set n [string length $title] |
drh | 4380ff8 | 2015-11-03 15:16:21 +0000 | [diff] [blame] | 559 | PUTS "starting: ${title} at [now]" |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 560 | flush stdout |
| 561 | } |
| 562 | |
| 563 | # Run the job. |
| 564 | # |
| 565 | set tm1 [clock seconds] |
| 566 | incr G(nJob) |
mistachkin | 5918943 | 2015-11-02 21:05:56 +0000 | [diff] [blame] | 567 | set script [file normalize [info script]] |
| 568 | set fd [open "|[info nameofexecutable] $script --slave" r+] |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 569 | fconfigure $fd -blocking 0 |
| 570 | fileevent $fd readable [list slave_fileevent $fd $T $tm1] |
dan | d08a63a | 2015-11-02 20:52:20 +0000 | [diff] [blame] | 571 | puts $fd [list $::TRACE $::MSVC $::DRYRUN] |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 572 | puts $fd [list {*}$T] |
| 573 | flush $fd |
| 574 | } |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | proc add_test_suite {listvar name testtarget config} { |
| 579 | upvar $listvar alltests |
| 580 | |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 581 | # Tcl variable $opts is used to build up the value used to set the |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 582 | # OPTS Makefile variable. Variable $cflags holds the value for |
| 583 | # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but |
| 584 | # CFLAGS is only passed to gcc. |
| 585 | # |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 586 | set makeOpts "" |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 587 | set cflags [expr {$::MSVC ? "-Zi" : "-g"}] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 588 | set opts "" |
drh | a780d8d | 2015-01-03 18:59:17 +0000 | [diff] [blame] | 589 | set title ${name}($testtarget) |
drh | 0ef84d0 | 2015-04-24 17:50:37 +0000 | [diff] [blame] | 590 | set configOpts $::WITHTCL |
drh | a780d8d | 2015-01-03 18:59:17 +0000 | [diff] [blame] | 591 | |
drh | 149735d | 2015-01-01 19:53:10 +0000 | [diff] [blame] | 592 | regsub -all {#[^\n]*\n} $config \n config |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 593 | foreach arg $config { |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 594 | if {[regexp {^-[UD]} $arg]} { |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 595 | lappend opts $arg |
drh | 0ede9eb | 2015-01-10 16:49:23 +0000 | [diff] [blame] | 596 | } elseif {[regexp {^[A-Z]+=} $arg]} { |
drh | 149735d | 2015-01-01 19:53:10 +0000 | [diff] [blame] | 597 | lappend testtarget $arg |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 598 | } elseif {[regexp {^--(enable|disable)-} $arg]} { |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 599 | if {$::MSVC} { |
| 600 | if {$arg eq "--disable-amalgamation"} { |
| 601 | lappend makeOpts USE_AMALGAMATION=0 |
| 602 | continue |
| 603 | } |
| 604 | if {$arg eq "--disable-shared"} { |
| 605 | lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0 |
| 606 | continue |
| 607 | } |
| 608 | if {$arg eq "--enable-fts5"} { |
| 609 | lappend opts -DSQLITE_ENABLE_FTS5 |
| 610 | continue |
| 611 | } |
| 612 | if {$arg eq "--enable-json1"} { |
| 613 | lappend opts -DSQLITE_ENABLE_JSON1 |
| 614 | continue |
| 615 | } |
mistachkin | 7d3bfa2 | 2015-11-03 06:23:33 +0000 | [diff] [blame] | 616 | if {$arg eq "--enable-shared"} { |
| 617 | lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1 |
| 618 | continue |
| 619 | } |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 620 | } |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 621 | lappend configOpts $arg |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 622 | } else { |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 623 | if {$::MSVC} { |
| 624 | if {$arg eq "-g"} { |
| 625 | lappend cflags -Zi |
| 626 | continue |
| 627 | } |
| 628 | if {[regexp -- {^-O(\d+)$} $arg all level]} then { |
| 629 | lappend makeOpts OPTIMIZATIONS=$level |
| 630 | continue |
| 631 | } |
| 632 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 633 | lappend cflags $arg |
| 634 | } |
| 635 | } |
| 636 | |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 637 | # Disable sync to make testing faster. |
| 638 | # |
| 639 | lappend opts -DSQLITE_NO_SYNC=1 |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 640 | |
| 641 | # Some configurations already set HAVE_USLEEP; in that case, skip it. |
| 642 | # |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 643 | if {[lsearch -regexp $opts {^-DHAVE_USLEEP(?:=|$)}]==-1} { |
| 644 | lappend opts -DHAVE_USLEEP=1 |
| 645 | } |
| 646 | |
| 647 | # Add the define for this platform. |
| 648 | # |
| 649 | if {$::tcl_platform(platform)=="windows"} { |
| 650 | lappend opts -DSQLITE_OS_WIN=1 |
| 651 | } else { |
| 652 | lappend opts -DSQLITE_OS_UNIX=1 |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 653 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 654 | |
| 655 | # Set the sub-directory to use. |
| 656 | # |
| 657 | set dir [string tolower [string map {- _ " " _} $name]] |
| 658 | |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 659 | # Join option lists into strings, using space as delimiter. |
| 660 | # |
| 661 | set makeOpts [join $makeOpts " "] |
| 662 | set cflags [join $cflags " "] |
| 663 | set opts [join $opts " "] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 664 | |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 665 | lappend alltests [list \ |
| 666 | $title $dir $configOpts $testtarget $makeOpts $cflags $opts] |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 667 | } |
| 668 | |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 669 | # The following procedure returns the "configure" command to be exectued for |
| 670 | # the current platform, which may be Windows (via MinGW, etc). |
| 671 | # |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 672 | proc configureCommand {opts} { |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 673 | if {$::MSVC} return [list]; # This is not needed for MSVC. |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 674 | set result [list trace_cmd exec] |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 675 | if {$::tcl_platform(platform)=="windows"} { |
| 676 | lappend result sh |
| 677 | } |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 678 | lappend result $::SRCDIR/configure --enable-load-extension |
| 679 | foreach x $opts {lappend result $x} |
| 680 | lappend result >& test.log |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 681 | } |
| 682 | |
| 683 | # The following procedure returns the "make" command to be executed for the |
| 684 | # specified targets, compiler flags, and options. |
| 685 | # |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 686 | proc makeCommand { targets makeOpts cflags opts } { |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 687 | set result [list trace_cmd exec] |
| 688 | if {$::MSVC} { |
| 689 | set nmakeDir [file nativename $::SRCDIR] |
mistachkin | 98fea32 | 2015-11-03 02:47:11 +0000 | [diff] [blame] | 690 | set nmakeFile [file nativename [file join $nmakeDir Makefile.msc]] |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 691 | lappend result nmake /f $nmakeFile TOP=$nmakeDir |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 692 | } else { |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 693 | lappend result make |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 694 | } |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 695 | foreach makeOpt $makeOpts { |
| 696 | lappend result $makeOpt |
| 697 | } |
| 698 | lappend result clean |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 699 | foreach target $targets { |
| 700 | lappend result $target |
| 701 | } |
| 702 | lappend result CFLAGS=$cflags OPTS=$opts >>& test.log |
| 703 | } |
| 704 | |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 705 | # The following procedure prints its arguments if ::TRACE is true. |
| 706 | # And it executes the command of its arguments in the calling context |
| 707 | # if ::DRYRUN is false. |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 708 | # |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 709 | proc trace_cmd {args} { |
| 710 | if {$::TRACE} { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 711 | PUTS $args |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 712 | } |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 713 | set res "" |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 714 | if {!$::DRYRUN} { |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 715 | set res [uplevel 1 $args] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 716 | } |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 717 | return $res |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | |
| 721 | # This proc processes the command line options passed to this script. |
| 722 | # Currently the only option supported is "-makefile", default |
| 723 | # "releasetest.mk". Set the ::MAKEFILE variable to the value of this |
| 724 | # option. |
| 725 | # |
| 726 | proc process_options {argv} { |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 727 | set ::SRCDIR [file normalize [file dirname [file dirname $::argv0]]] |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 728 | set ::QUICK 0 |
| 729 | set ::MSVC 0 |
| 730 | set ::BUILDONLY 0 |
| 731 | set ::DRYRUN 0 |
| 732 | set ::TRACE 0 |
| 733 | set ::JOBS 1 |
| 734 | set ::PROGRESS_MSGS 0 |
| 735 | set ::WITHTCL {} |
drh | 2eeb7ae | 2014-10-10 17:44:03 +0000 | [diff] [blame] | 736 | set config {} |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 737 | set platform $::tcl_platform(os)-$::tcl_platform(machine) |
| 738 | |
| 739 | for {set i 0} {$i < [llength $argv]} {incr i} { |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 740 | set x [lindex $argv $i] |
| 741 | if {[regexp {^--[a-z]} $x]} {set x [string range $x 1 end]} |
drh | f167a40 | 2015-01-07 18:44:59 +0000 | [diff] [blame] | 742 | switch -glob -- $x { |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 743 | -slave { |
| 744 | run_slave_test |
| 745 | exit |
| 746 | } |
| 747 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 748 | -srcdir { |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 749 | incr i |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 750 | set ::SRCDIR [file normalize [lindex $argv $i]] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 751 | } |
| 752 | |
| 753 | -platform { |
| 754 | incr i |
| 755 | set platform [lindex $argv $i] |
| 756 | } |
| 757 | |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 758 | -jobs { |
| 759 | incr i |
| 760 | set ::JOBS [lindex $argv $i] |
| 761 | } |
| 762 | |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 763 | -progress { |
| 764 | set ::PROGRESS_MSGS 1 |
| 765 | } |
| 766 | |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 767 | -quick { |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 768 | set ::QUICK 1 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 769 | } |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 770 | -veryquick { |
| 771 | set ::QUICK 2 |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 772 | } |
drh | 2eeb7ae | 2014-10-10 17:44:03 +0000 | [diff] [blame] | 773 | |
| 774 | -config { |
| 775 | incr i |
| 776 | set config [lindex $argv $i] |
| 777 | } |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 778 | |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 779 | -msvc { |
| 780 | set ::MSVC 1 |
| 781 | } |
| 782 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 783 | -buildonly { |
| 784 | set ::BUILDONLY 1 |
| 785 | } |
| 786 | |
| 787 | -dryrun { |
| 788 | set ::DRYRUN 1 |
| 789 | } |
| 790 | |
drh | 8f45555 | 2015-01-07 14:41:18 +0000 | [diff] [blame] | 791 | -trace { |
| 792 | set ::TRACE 1 |
| 793 | } |
| 794 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 795 | -info { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 796 | PUTS "Command-line Options:" |
| 797 | PUTS " --srcdir $::SRCDIR" |
| 798 | PUTS " --platform [list $platform]" |
| 799 | PUTS " --config [list $config]" |
drh | 905da63 | 2015-06-10 18:53:09 +0000 | [diff] [blame] | 800 | if {$::QUICK} { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 801 | if {$::QUICK==1} {PUTS " --quick"} |
| 802 | if {$::QUICK==2} {PUTS " --veryquick"} |
drh | 905da63 | 2015-06-10 18:53:09 +0000 | [diff] [blame] | 803 | } |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 804 | if {$::MSVC} {PUTS " --msvc"} |
| 805 | if {$::BUILDONLY} {PUTS " --buildonly"} |
| 806 | if {$::DRYRUN} {PUTS " --dryrun"} |
| 807 | if {$::TRACE} {PUTS " --trace"} |
| 808 | PUTS "\nAvailable --platform options:" |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 809 | foreach y [lsort [array names ::Platforms]] { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 810 | PUTS " [list $y]" |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 811 | } |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 812 | PUTS "\nAvailable --config options:" |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 813 | foreach y [lsort [array names ::Configs]] { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 814 | PUTS " [list $y]" |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 815 | } |
| 816 | exit |
| 817 | } |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 818 | |
| 819 | -g { |
mistachkin | da9da56 | 2015-11-02 23:29:58 +0000 | [diff] [blame] | 820 | lappend ::EXTRACONFIG [lindex $argv $i] |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 821 | } |
| 822 | |
drh | 0ef84d0 | 2015-04-24 17:50:37 +0000 | [diff] [blame] | 823 | -with-tcl=* { |
| 824 | set ::WITHTCL -$x |
| 825 | } |
| 826 | |
drh | f167a40 | 2015-01-07 18:44:59 +0000 | [diff] [blame] | 827 | -D* - |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 828 | -O* - |
drh | f167a40 | 2015-01-07 18:44:59 +0000 | [diff] [blame] | 829 | -enable-* - |
| 830 | -disable-* - |
| 831 | *=* { |
| 832 | lappend ::EXTRACONFIG [lindex $argv $i] |
| 833 | } |
mistachkin | 7284056 | 2014-12-23 20:22:57 +0000 | [diff] [blame] | 834 | |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 835 | default { |
drh | 573d88e | 2016-01-03 11:17:04 +0000 | [diff] [blame] | 836 | PUTSERR "" |
| 837 | PUTSERR [string trim $::USAGE_MESSAGE] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 838 | exit -1 |
| 839 | } |
| 840 | } |
| 841 | } |
| 842 | |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 843 | if {0==[info exists ::Platforms($platform)]} { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 844 | PUTS "Unknown platform: $platform" |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 845 | PUTSNNL "Set the -platform option to " |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 846 | set print [list] |
| 847 | foreach p [array names ::Platforms] { |
| 848 | lappend print "\"$p\"" |
| 849 | } |
| 850 | lset print end "or [lindex $print end]" |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 851 | PUTS "[join $print {, }]." |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 852 | exit |
| 853 | } |
| 854 | |
drh | 2eeb7ae | 2014-10-10 17:44:03 +0000 | [diff] [blame] | 855 | if {$config!=""} { |
drh | e35626f | 2014-10-10 17:47:00 +0000 | [diff] [blame] | 856 | if {[llength $config]==1} {lappend config fulltest} |
drh | 2eeb7ae | 2014-10-10 17:44:03 +0000 | [diff] [blame] | 857 | set ::CONFIGLIST $config |
| 858 | } else { |
drh | 71258ab | 2015-11-04 16:34:58 +0000 | [diff] [blame] | 859 | if {$::JOBS>1} { |
| 860 | set ::CONFIGLIST {} |
| 861 | foreach {target zConfig} [lreverse $::Platforms($platform)] { |
| 862 | append ::CONFIGLIST [format " %-25s %s\n" \ |
| 863 | [list $zConfig] [list $target]] |
| 864 | } |
| 865 | } else { |
| 866 | set ::CONFIGLIST $::Platforms($platform) |
| 867 | } |
drh | 2eeb7ae | 2014-10-10 17:44:03 +0000 | [diff] [blame] | 868 | } |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 869 | PUTS "Running the following test configurations for $platform:" |
| 870 | PUTS " [string trim $::CONFIGLIST]" |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 871 | PUTSNNL "Flags:" |
| 872 | if {$::PROGRESS_MSGS} {PUTSNNL " --progress"} |
| 873 | if {$::DRYRUN} {PUTSNNL " --dryrun"} |
| 874 | if {$::BUILDONLY} {PUTSNNL " --buildonly"} |
| 875 | if {$::MSVC} {PUTSNNL " --msvc"} |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 876 | switch -- $::QUICK { |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 877 | 1 {PUTSNNL " --quick"} |
| 878 | 2 {PUTSNNL " --veryquick"} |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 879 | } |
drh | d63fbb7 | 2015-11-13 12:52:34 +0000 | [diff] [blame] | 880 | if {$::JOBS>1} {PUTSNNL " --jobs $::JOBS"} |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 881 | PUTS "" |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 882 | } |
| 883 | |
| 884 | # Main routine. |
| 885 | # |
| 886 | proc main {argv} { |
| 887 | |
| 888 | # Process any command line options. |
drh | f167a40 | 2015-01-07 18:44:59 +0000 | [diff] [blame] | 889 | set ::EXTRACONFIG {} |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 890 | process_options $argv |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 891 | PUTS [string repeat * 79] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 892 | |
drh | 97876ee | 2014-12-24 23:35:36 +0000 | [diff] [blame] | 893 | set ::NERR 0 |
| 894 | set ::NTEST 0 |
drh | 277b4e4 | 2014-12-29 02:55:58 +0000 | [diff] [blame] | 895 | set ::NTESTCASE 0 |
| 896 | set ::NERRCASE 0 |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 897 | set ::SQLITE_VERSION {} |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 898 | set STARTTIME [clock seconds] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 899 | foreach {zConfig target} $::CONFIGLIST { |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 900 | if {$::MSVC && ($zConfig eq "Sanitize" || "checksymbols" in $target |
| 901 | || "valgrindtest" in $target)} { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 902 | PUTS "Skipping $zConfig / $target for MSVC..." |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 903 | continue |
| 904 | } |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 905 | if {$target ne "checksymbols"} { |
| 906 | switch -- $::QUICK { |
drh | 905da63 | 2015-06-10 18:53:09 +0000 | [diff] [blame] | 907 | 1 {set target quicktest} |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 908 | 2 {set target smoketest} |
| 909 | } |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 910 | if {$::BUILDONLY} { |
| 911 | set target testfixture |
drh | 7f8a93d | 2015-11-03 15:39:29 +0000 | [diff] [blame] | 912 | if {$::tcl_platform(platform)=="windows"} { |
| 913 | append target .exe |
| 914 | } |
mistachkin | 00eb70d | 2015-04-04 00:02:07 +0000 | [diff] [blame] | 915 | } |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 916 | } |
drh | f167a40 | 2015-01-07 18:44:59 +0000 | [diff] [blame] | 917 | set config_options [concat $::Configs($zConfig) $::EXTRACONFIG] |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 918 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 919 | incr NTEST |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 920 | add_test_suite all $zConfig $target $config_options |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 921 | |
| 922 | # If the configuration included the SQLITE_DEBUG option, then remove |
| 923 | # it and run veryquick.test. If it did not include the SQLITE_DEBUG option |
| 924 | # add it and run veryquick.test. |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 925 | if {$target!="checksymbols" && $target!="valgrindtest" |
drh | f332071 | 2015-04-25 13:39:29 +0000 | [diff] [blame] | 926 | && $target!="fuzzoomtest" && !$::BUILDONLY && $::QUICK<2} { |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 927 | set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*] |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 928 | set xtarget $target |
drh | af700b3 | 2014-12-31 20:35:11 +0000 | [diff] [blame] | 929 | regsub -all {fulltest[a-z]*} $xtarget test xtarget |
drh | f332071 | 2015-04-25 13:39:29 +0000 | [diff] [blame] | 930 | regsub -all {fuzzoomtest} $xtarget fuzztest xtarget |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 931 | if {$debug_idx < 0} { |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 932 | incr NTEST |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 933 | append config_options " -DSQLITE_DEBUG=1" |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 934 | add_test_suite all "${zConfig}_debug" $xtarget $config_options |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 935 | } else { |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 936 | incr NTEST |
drh | bd41d56 | 2014-12-30 20:40:32 +0000 | [diff] [blame] | 937 | regsub { *-DSQLITE_MEMDEBUG[^ ]* *} $config_options { } config_options |
| 938 | regsub { *-DSQLITE_DEBUG[^ ]* *} $config_options { } config_options |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 939 | add_test_suite all "${zConfig}_ndebug" $xtarget $config_options |
dan | b136e90 | 2012-12-10 10:22:48 +0000 | [diff] [blame] | 940 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 941 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 942 | } |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 943 | |
dan | a7f6597 | 2015-11-02 18:32:00 +0000 | [diff] [blame] | 944 | run_all_test_suites $all |
| 945 | |
drh | d477eee | 2014-12-23 19:40:51 +0000 | [diff] [blame] | 946 | set elapsetime [expr {[clock seconds]-$STARTTIME}] |
drh | 97876ee | 2014-12-24 23:35:36 +0000 | [diff] [blame] | 947 | set hr [expr {$elapsetime/3600}] |
| 948 | set min [expr {($elapsetime/60)%60}] |
| 949 | set sec [expr {$elapsetime%60}] |
| 950 | set etime [format (%02d:%02d:%02d) $hr $min $sec] |
drh | 573d88e | 2016-01-03 11:17:04 +0000 | [diff] [blame] | 951 | if {$::JOBS>1} {append etime " $::JOBS cores"} |
| 952 | if {[catch {exec hostname} HNAME]==0} {append etime " on $HNAME"} |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 953 | PUTS [string repeat * 79] |
drh | b1031f0 | 2015-09-10 15:20:49 +0000 | [diff] [blame] | 954 | incr ::NERRCASE $::NERR |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 955 | PUTS "$::NERRCASE failures out of $::NTESTCASE tests in $etime" |
drh | 5bfff9d | 2015-01-08 01:05:42 +0000 | [diff] [blame] | 956 | if {$::SQLITE_VERSION ne ""} { |
drh | e31dc59 | 2015-08-14 12:53:37 +0000 | [diff] [blame] | 957 | PUTS "SQLite $::SQLITE_VERSION" |
drh | 96110de | 2010-09-06 18:44:14 +0000 | [diff] [blame] | 958 | } |
| 959 | } |
| 960 | |
| 961 | main $argv |