]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove proprietary information from the releasetest.tcl script and add it
authordrh <drh@noemail.net>
Mon, 6 Sep 2010 18:44:14 +0000 (18:44 +0000)
committerdrh <drh@noemail.net>
Mon, 6 Sep 2010 18:44:14 +0000 (18:44 +0000)
to the public repository.

FossilOrigin-Name: e1d4a87e4e195b3a217f6d8a15d6beceb7c22a53

manifest
manifest.uuid
test/releasetest.mk [new file with mode: 0644]
test/releasetest.tcl [new file with mode: 0644]

index 71686bc277f1864f19b77b400b35c4e829c25113..697a2e63be654d679a0b29f4b181b9c2bd32959e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,8 @@
-C Add\stest\sfile\se_select.test.
-D 2010-09-04T18:52:30
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+C Remove\sproprietary\sinformation\sfrom\sthe\sreleasetest.tcl\sscript\sand\sadd\sit\nto\sthe\spublic\srepository.
+D 2010-09-06T18:44:14
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in c599a15d268b1db2aeadea19df2adc3bf2eb6bee
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -569,6 +572,8 @@ F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
 F test/randexpr1.test 1084050991e9ba22c1c10edd8d84673b501cc25a
 F test/rdonly.test c267d050a1d9a6a321de502b737daf28821a518d
 F test/reindex.test 44edd3966b474468b823d481eafef0c305022254
+F test/releasetest.mk 2eced2f9ae701fd0a29e714a241760503ccba25a
+F test/releasetest.tcl 138b6fb0c5054114903a8d9862130f7f6aa9cf35
 F test/rollback.test 1a83118ea6db4e7d8c10eaa63871b5e90502ffdc
 F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
 F test/rowid.test e58e0acef38b527ed1b0b70d3ada588f804af287
@@ -854,7 +859,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P f06c7b1973d64a6a1a1db2b44df2a4eb0ece0077
-R ff12553912aafce92749cd560cb5ebc9
-U dan
-Z a3043953a2e784f32d9ae6b144aa3d3f
+P 8b9d8c226e5d95584c1e61a796dc23b780a300cb
+R 98dea5240f80f8174c5125044e6828fb
+U drh
+Z 0392d0f0caa40596afb3d46f32529306
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQFMhTaBoxKgR168RlERAn1UAJwNSxNdDB4M8CdfcOLn13Q/PByDLwCfTCOc
+2twVoGYmMf1gW4MdyOjJ5f0=
+=zO5S
+-----END PGP SIGNATURE-----
index a0f59363034aa029e02d20273887f5ed760339da..9c56ebca60431b3a8772da2e4cee36347372592c 100644 (file)
@@ -1 +1 @@
-8b9d8c226e5d95584c1e61a796dc23b780a300cb
\ No newline at end of file
+e1d4a87e4e195b3a217f6d8a15d6beceb7c22a53
\ No newline at end of file
diff --git a/test/releasetest.mk b/test/releasetest.mk
new file mode 100644 (file)
index 0000000..5d217c6
--- /dev/null
@@ -0,0 +1,14 @@
+########################################################
+TOP=/home/drh/sqlite/sqlite
+
+TCL_FLAGS=-I/home/drh/tcltk/86linux
+LIBTCL=/home/drh/tcltk/86linux/libtcl8.6.a -lm -ldl -lpthread
+
+BCC = gcc
+TCC = gcc -ansi -g $(CFLAGS)
+NAWK   = awk
+AR     = ar cr
+RANLIB = ranlib
+THREADLIB = -lpthread -ldl -lz
+include $(TOP)/main.mk
+########################################################
diff --git a/test/releasetest.tcl b/test/releasetest.tcl
new file mode 100644 (file)
index 0000000..c29bc7e
--- /dev/null
@@ -0,0 +1,310 @@
+
+set rcsid {$Id: $}
+
+# 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:
+
+    -makefile PATH-TO-MAKEFILE           (default "releasetest.mk")
+    -platform PLATFORM                   (see below)
+    -quick    BOOLEAN                    (default "0")
+
+The default value for -makefile is "./releasetest.mk".
+
+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".
+
+If the -quick option is set to true, then the "veryquick.test" script
+is run for all compilation configurations. Otherwise, sometimes "all.test"
+is run, sometimes "veryquick.test".
+
+Almost any SQLite makefile (except those generated by configure - see below)
+should work. The following properties are required:
+
+  * The makefile should support the "fulltest" target.
+  * The makefile should support the variable "OPTS" as a way to pass
+    options from the make command line to lemon and the C compiler.
+
+More precisely, the following invocation must be supported:
+
+  make -f $::MAKEFILE fulltest OPTS="-DSQLITE_SECURE_DELETE=1 -DSQLITE_DEBUG=1"
+
+Makefiles generated by the sqlite configure program cannot be used as
+they do not respect the OPTS variable.
+
+Example Makefile contents:
+
+  ########################################################
+  TOP=/home/dan/work/sqlite/sqlite
+
+  TCL_FLAGS=-I/home/dan/tcl/include
+  LIBTCL=-L/home/dan/tcl/lib -ltcl
+
+  BCC = gcc
+  TCC = gcc -ansi -g $(CFLAGS)
+  NAWK   = awk
+  AR     = ar cr
+  RANLIB = ranlib
+  THREADLIB = -lpthread -ldl
+  include $(TOP)/main.mk
+  ########################################################
+}
+
+array set ::Configs {
+  "Default" {
+    -O2
+  }
+  "Unlock-Notify" {
+    -O2
+    -DSQLITE_ENABLE_UNLOCK_NOTIFY
+    -DSQLITE_THREADSAFE
+    -DOS_UNIX
+    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
+  }
+  "Secure-Delete" {
+    -O2
+    -DSQLITE_SECURE_DELETE=1
+    -DSQLITE_SOUNDEX=1
+  }
+  "Update-Delete-Limit" {
+    -O2
+    -DSQLITE_DEFAULT_FILE_FORMAT=4
+    -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1
+  }
+  "Debug-One" {
+    -O2
+    -DSQLITE_DEBUG=1
+    -DSQLITE_MEMDEBUG=1
+    -DSQLITE_MUTEX_NOOP=1
+    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
+    -DSQLITE_ENABLE_FTS3=1
+    -DSQLITE_ENABLE_RTREE=1
+    -DSQLITE_ENABLE_MEMSYS5=1
+    -DSQLITE_ENABLE_MEMSYS3=1
+    -DSQLITE_ENABLE_COLUMN_METADATA=1
+  }
+  "Memory-Leak" {
+    -O2
+    -DSQLITE_DEBUG=1
+    -DSQLITE_MEMDEBUG=1
+    -DSQLITE_OMIT_LOOKASIDE=1
+    -DSQLITE_ENABLE_ASYNCIO=1
+    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
+  }
+  "Device-One" {
+    -O2
+    -DSQLITE_DEBUG=1
+    -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1
+    -DSQLITE_DISABLE_LFS=1
+    -DSQLITE_DEFAULT_AUTOVACUUM=1
+    -DSQLITE_DEFAULT_PAGE_SIZE=1024
+    -DSQLITE_MAX_PAGE_SIZE=4096
+    -DSQLITE_DEFAULT_CACHE_SIZE=64
+    -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=32
+    -DSQLITE_TEMP_STORE=3
+    -DSQLITE_OMIT_PROGRESS_CALLBACK=1
+    -DSQLITE_OMIT_LOAD_EXTENSION=1
+    -DSQLITE_OMIT_VIRTUALTABLE=1
+    -DSQLITE_ENABLE_IOTRACE=1
+    -DSQLITE_ENABLE_ATOMIC_WRITE=1
+  }
+  "Locking-Style" {
+    -O2
+    -DSQLITE_ENABLE_LOCKING_STYLE=1
+  }
+  "OS-X" {
+    -DSQLITE_ENABLE_LOCKING_STYLE=1
+    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
+  }
+  "Extra-Robustness" {
+    -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
+  }
+  "Coverage" {
+    -O0
+    -fprofile-arcs
+    -ftest-coverage
+    -DSQLITE_COVERAGE_TEST=1
+  } 
+}
+
+array set ::Platforms {
+  Linux-x86_64 {
+    "Secure-Delete"           test
+    "Unlock-Notify"           "QUICKTEST_INCLUDE=notify2.test test"
+    "Device-One"              fulltest
+    "Update-Delete-Limit"     test
+    "Debug-One"               test
+    "Extra-Robustness"        test
+    "Memory-Leak"             fulltest
+    "Default"                 test
+  }
+  Linux-i686 {
+    "Default"                 test
+    "Unlock-Notify"           "QUICKTEST_INCLUDE=notify2.test test"
+    "Device-One"              fulltest
+  }
+  Darwin-i386 {
+    "OS-X"                    test
+    "Locking-Style"           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 ""
+  set opts ""
+  foreach arg $config {
+    if {[string match -D* $arg]} {
+      lappend opts $arg
+    } else {
+      lappend cflags $arg
+    }
+  }
+
+  set cflags [join $cflags " "]
+  set opts   [join $opts " "]
+  append opts " -DSQLITE_NO_SYNC=1 -DHAVE_USLEEP"
+
+  # Set the sub-directory to use.
+  #
+  set dir [string tolower [string map {- _ " " _} $name]]
+
+  if {$::tcl_platform(platform)=="windows"} {
+    append opts " -DSQLITE_OS_WIN=1"
+  } elseif {$::tcl_platform(platform)=="os2"} {
+    append opts " -DSQLITE_OS_OS2=1"
+  } else {
+    append opts " -DSQLITE_OS_UNIX=1"
+  }
+
+  # Run the test.
+  #
+  set makefile [file normalize $::MAKEFILE]
+  file mkdir $dir
+  puts -nonewline "Testing configuration \"$name\" (logfile=$dir/test.log)..."
+  flush stdout
+
+  set makecmd [concat                                  \
+    [list exec make -C $dir -f $makefile clean]        \
+    $testtarget                                        \
+    [list CFLAGS=$cflags OPTS=$opts >& $dir/test.log]  \
+  ]
+  set rc [catch $makecmd]
+
+  if {$rc} {
+    puts " FAILED."
+  } else {
+    puts "Ok."
+  }
+}
+
+
+# This proc processes the command line options passed to this script.
+# Currently the only option supported is "-makefile", default
+# "releasetest.mk". Set the ::MAKEFILE variable to the value of this
+# option.
+#
+proc process_options {argv} {
+  set ::MAKEFILE releasetest.mk                       ;# Default value
+  set ::QUICK    0                                    ;# Default value
+  set platform $::tcl_platform(os)-$::tcl_platform(machine)
+
+  for {set i 0} {$i < [llength $argv]} {incr i} {
+    switch -- [lindex $argv $i] {
+      -makefile {
+        incr i
+        set ::MAKEFILE [lindex $argv $i]
+      }
+
+      -platform {
+        incr i
+        set platform [lindex $argv $i]
+      }
+
+      -quick {
+        incr i
+        set ::QUICK [lindex $argv $i]
+      }
+  
+      default {
+        puts stderr ""
+        puts stderr [string trim $::USAGE_MESSAGE]
+        exit -1
+      }
+    }
+  }
+
+  set ::MAKEFILE [file normalize $::MAKEFILE]
+
+  if {0==[info exists ::Platforms($platform)]} {
+    puts "Unknown platform: $platform"
+    puts -nonewline "Set the -platform option to "
+    set print [list]
+    foreach p [array names ::Platforms] {
+      lappend print "\"$p\""
+    }
+    lset print end "or [lindex $print end]"
+    puts "[join $print {, }]."
+    exit
+  }
+
+  set ::CONFIGLIST $::Platforms($platform)
+  puts "Running the following configurations for $platform:"
+  puts "    [string trim $::CONFIGLIST]"
+}
+
+# Main routine.
+#
+proc main {argv} {
+
+  # Process any command line options.
+  process_options $argv
+
+  foreach {zConfig target} $::CONFIGLIST {
+    if {$::QUICK} {set target test}
+    set config_options $::Configs($zConfig)
+
+    run_test_suite $zConfig $target $config_options
+
+    # If the configuration included the SQLITE_DEBUG option, then remove
+    # it and run veryquick.test. If it did not include the SQLITE_DEBUG option
+    # add it and run veryquick.test.
+    set debug_idx [lsearch -glob $config_options -DSQLITE_DEBUG*]
+    if {$debug_idx < 0} {
+      run_test_suite "${zConfig}_debug" test [
+        concat $config_options -DSQLITE_DEBUG=1
+      ]
+    } else {
+      run_test_suite "${zConfig}_ndebug" test [
+        lreplace $config_options $debug_idx $debug_idx
+      ]
+    }
+
+  }
+}
+
+main $argv