SQLite

Check-in [af166c5c64]
Login

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

Overview
Comment:Draft of changes necessary to make releasetest work on Windows via MinGW.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | releasetest-refactor
Files: files | file ages | folders
SHA1: af166c5c64216d845269410d1ac2493310694b86
User & Date: mistachkin 2014-12-23 20:22:57.094
Context
2014-12-23
20:31
Add the threadtest target to Makefile.in. Add --enable-load-extension to the configure issued by releasetest.tcl. (check-in: cb128067fa user: drh tags: releasetest-refactor)
20:22
Draft of changes necessary to make releasetest work on Windows via MinGW. (check-in: af166c5c64 user: mistachkin tags: releasetest-refactor)
19:52
Add the "checksymbols" target to Makefile.in (check-in: 5bd73dba5e user: drh tags: releasetest-refactor)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/releasetest.tcl.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/tclsh
#
# Documentation for this script. This may be output to stderr
# if the script is invoked incorrectly. See the [process_options]
# proc below.
#
set ::USAGE_MESSAGE {
This Tcl script is used to test the various configurations required
before releasing a new version. Supported command line options (all 
optional) are:

    --srcdir   TOP-OF-SQLITE-TREE      (see below)
    --platform PLATFORM                (see below)
    --config   CONFIGNAME              (Run only CONFIGNAME)
    --quick                            (Run "veryquick.test" only)
    --buildonly                        (Just build testfixture - do not run)
    --dryrun                           (Print what would have happened)      
    --info                             (Show diagnostic info)

The default value for --srcdir is the parent of the directory holding
this script.

The script determines the default value for --platform using the
$tcl_platform(os) and $tcl_platform(machine) variables. Supported 
platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386".

Every test begins with a fresh run of the configure script at the top
of the SQLite source tree.
}

array set ::Configs {








|







|






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/tclsh
#
# Documentation for this script. This may be output to stderr
# if the script is invoked incorrectly. See the [process_options]
# proc below.
#
set ::USAGE_MESSAGE {
This Tcl script is used to test the various configurations required
before releasing a new version. Supported command line options (all
optional) are:

    --srcdir   TOP-OF-SQLITE-TREE      (see below)
    --platform PLATFORM                (see below)
    --config   CONFIGNAME              (Run only CONFIGNAME)
    --quick                            (Run "veryquick.test" only)
    --buildonly                        (Just build testfixture - do not run)
    --dryrun                           (Print what would have happened)
    --info                             (Show diagnostic info)

The default value for --srcdir is the parent of the directory holding
this script.

The script determines the default value for --platform using the
$tcl_platform(os) and $tcl_platform(machine) variables. Supported
platforms are "Linux-x86", "Linux-x86_64" and "Darwin-i386".

Every test begins with a fresh run of the configure script at the top
of the SQLite source tree.
}

array set ::Configs {
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    -DUSE_PREAD=1
    -DSQLITE_ENABLE_RTREE=1
    -DSQLITE_ENABLE_FTS3=1
    -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
    -DSQLITE_DEFAULT_CACHE_SIZE=1000
    -DSQLITE_MAX_LENGTH=2147483645
    -DSQLITE_MAX_VARIABLE_NUMBER=500000
    -DSQLITE_DEBUG=1 
    -DSQLITE_PREFER_PROXY_LOCKING=1
  }
  "Extra-Robustness" {
    -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
    -DSQLITE_MAX_ATTACHED=62
  }
  "Devkit" {







|







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    -DUSE_PREAD=1
    -DSQLITE_ENABLE_RTREE=1
    -DSQLITE_ENABLE_FTS3=1
    -DSQLITE_ENABLE_FTS3_PARENTHESIS=1
    -DSQLITE_DEFAULT_CACHE_SIZE=1000
    -DSQLITE_MAX_LENGTH=2147483645
    -DSQLITE_MAX_VARIABLE_NUMBER=500000
    -DSQLITE_DEBUG=1
    -DSQLITE_PREFER_PROXY_LOCKING=1
  }
  "Extra-Robustness" {
    -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
    -DSQLITE_MAX_ATTACHED=62
  }
  "Devkit" {
178
179
180
181
182
183
184



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
    "Device-Two"              test
    "Default"                 "threadtest fulltest"
  }
  Darwin-i386 {
    "Locking-Style"           test
    "OS-X"                    "threadtest fulltest"
  }



}


# End of configuration section.
#########################################################################
#########################################################################

foreach {key value} [array get ::Platforms] {
  foreach {v t} $value {
    if {0==[info exists ::Configs($v)]} {
      puts stderr "No such configuration: \"$v\""
      exit -1
    }
  }
}

proc run_test_suite {name testtarget config} {
  # Tcl variable $opts is used to build up the value used to set the 
  # OPTS Makefile variable. Variable $cflags holds the value for
  # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but
  # CFLAGS is only passed to gcc.
  #
  set cflags "-g"
  set opts ""
  foreach arg $config {







>
>
>

















|







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
    "Device-Two"              test
    "Default"                 "threadtest fulltest"
  }
  Darwin-i386 {
    "Locking-Style"           test
    "OS-X"                    "threadtest fulltest"
  }
  "Windows NT-intel" {
    "Default"                 "threadtest fulltest"
  }
}


# End of configuration section.
#########################################################################
#########################################################################

foreach {key value} [array get ::Platforms] {
  foreach {v t} $value {
    if {0==[info exists ::Configs($v)]} {
      puts stderr "No such configuration: \"$v\""
      exit -1
    }
  }
}

proc run_test_suite {name testtarget config} {
  # Tcl variable $opts is used to build up the value used to set the
  # OPTS Makefile variable. Variable $cflags holds the value for
  # CFLAGS. The makefile will pass OPTS to both gcc and lemon, but
  # CFLAGS is only passed to gcc.
  #
  set cflags "-g"
  set opts ""
  foreach arg $config {
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261






















262
263
264
265
266
267
268
269
270
    puts -nonewline "${name}[string repeat . [expr {40-$n}]]"
    flush stdout
  }

  set tm1 [clock seconds]
  set origdir [pwd]
  dryrun cd $dir
  set rc [catch [list dryrun exec $::SRCDIR/configure >& test.log]]
  if {!$rc} {
    set rc [catch [list dryrun exec make clean $testtarget \
                             CFLAGS=$cflags OPTS=$opts >>& test.log]]
  }
  set tm2 [clock seconds]
  dryrun cd $origdir

  if {!$::DRYRUN} {
    set minutes [expr {($tm2-$tm1)/60}]
    set seconds [expr {($tm2-$tm1)%60}]
    set tm [format (%02d:%02d) $minutes $seconds]
    if {$rc} {
      puts " FAIL $tm"
      incr ::NERR
    } else {
      puts " Ok   $tm"
    }
  }
}























# The following procedure either prints its arguments (if ::DRYRUN is true)
# or executes the command of its arguments in the calling context 
# (if ::DRYRUN is false).
#
proc dryrun {args} {
  if {$::DRYRUN} {
    puts $args
  } else {
    uplevel 1 $args







|

|
<

















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|







237
238
239
240
241
242
243
244
245
246

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
    puts -nonewline "${name}[string repeat . [expr {40-$n}]]"
    flush stdout
  }

  set tm1 [clock seconds]
  set origdir [pwd]
  dryrun cd $dir
  set rc [catch [configureCommand]]
  if {!$rc} {
    set rc [catch [makeCommand $testtarget $cflags $opts]]

  }
  set tm2 [clock seconds]
  dryrun cd $origdir

  if {!$::DRYRUN} {
    set minutes [expr {($tm2-$tm1)/60}]
    set seconds [expr {($tm2-$tm1)%60}]
    set tm [format (%02d:%02d) $minutes $seconds]
    if {$rc} {
      puts " FAIL $tm"
      incr ::NERR
    } else {
      puts " Ok   $tm"
    }
  }
}

# The following procedure returns the "configure" command to be exectued for
# the current platform, which may be Windows (via MinGW, etc).
#
proc configureCommand {} {
  set result [list dryrun exec]
  if {$::tcl_platform(platform)=="windows"} {
    lappend result sh
  }
  lappend result $::SRCDIR/configure >& test.log
}

# The following procedure returns the "make" command to be executed for the
# specified targets, compiler flags, and options.
#
proc makeCommand { targets cflags opts } {
  set result [list dryrun exec make clean]
  foreach target $targets {
    lappend result $target
  }
  lappend result CFLAGS=$cflags OPTS=$opts >>& test.log
}

# The following procedure either prints its arguments (if ::DRYRUN is true)
# or executes the command of its arguments in the calling context
# (if ::DRYRUN is false).
#
proc dryrun {args} {
  if {$::DRYRUN} {
    puts $args
  } else {
    uplevel 1 $args
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
        }
        puts "\nAvailable --config options:"
        foreach y [lsort [array names ::Configs]] {
          puts "   [list $y]"
        }
        exit
      }
  
      default {
        puts stderr ""
        puts stderr [string trim $::USAGE_MESSAGE]
        exit -1
      }
    }
  }







|







355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
        }
        puts "\nAvailable --config options:"
        foreach y [lsort [array names ::Configs]] {
          puts "   [list $y]"
        }
        exit
      }

      default {
        puts stderr ""
        puts stderr [string trim $::USAGE_MESSAGE]
        exit -1
      }
    }
  }