Test Procedures For The SQLite TCL Extension

1.0 Background

The SQLite TCL extension logic (in the “tclsqlite.c” source file) is statically linked into “textfixture” executable which is the program used to do most of the testing associated with “make test”, “make devtest”, and/or “make releasetest”. So the functionality of the SQLite TCL extension is thoroughly vetted during normal testing. The procedures below are designed to test the loadable extension aspect of the SQLite TCL extension, and in particular to verify that the “make tclextension-install” build target works and that an ordinary tclsh can subsequently run “package require sqlite3”.

This procedure can also be used as a template for how to set up a local TCL+SQLite development environment. In other words, it can be be used as a guide on how to compile per-user copies of Tcl that are used to develop, test, and debug SQLite. In that case, perhaps make minor changes to the procedure such as:

  • Make TCLBUILD directory is permanent.
  • Enable debugging symbols on the Tcl library build.
  • Reduce the optimization level to -O0 for easier debugging.
  • Also compile “wish” to go with each “tclsh”.

2.0 Testing On Unix-like Systems (Including Mac)

See also the document which provides another perspective on how to compile SQLite on unix-like systems.

2.1 Setup

2.2 Testing TCL 8.x and 9.x on unix

From a checked-out copy of the core Tcl tree

2.3 Cleanup

3.0 Testing On Windows

See also the document which provides another perspective on how to compile SQLite on Windows.

3.1 Setup for Windows

(These docs are not as up-to-date as the Unix docs, above.)

3.2 Testing TCL 8.6 on Windows

3.3 Testing TCL 9.0 on Windows

3.4 Cleanup

4.0 Testing the TEA(ish) Build (unix only)

This part requires following the setup instructions for Unix systems, at the top of this document.

The former TEA, now TEA(ish), build of this extension uses the same code as the builds described above but is provided in a form more convenient for downstream Tcl users.

It lives in autoconf/tea and, as part of the autoconf bundle, cannot be tested directly from the canonical tree. Instead it has to be packaged.

4.1 Teaish Setup

Follow the same Tcl- and environment-related related setup described in the first section of this document, up to and including the installation of Tcl (unless, of course, it was already installed using those same instructions).

4.2 Teaish Testing

When actively developing and testing the teaish build, which requires going through the tarball generation, there's a caveat about the mkpkg_tmp_dir dir: it will be deleted every time a tarball is built, the shell console which is parked in that directory for testing needs to add cd $PWD && to the start of the build commands, like:

[user@host:.../mkpkg_tmp_dir/tea]$ \
  cd $PWD && ./configure CFLAGS=-O0 --with-tcl=$TCLHOME \
  && make test install uninstall

4.3 Teaish Cleanup