frejanordsiek / unit-test-tap

Scheme unit testing module providing TAP output with a similar API to SRFI-64.
GNU Lesser General Public License v2.1
1 stars 0 forks source link

unit-test-tap 0.1 Copyright (C) 2016 Freja Nordsiek License: LGPL 2.1 or later (see COPYING)

A TAP output based unit testing framework that is in the spirit of SRFI-64 (http://srfi.schemers.org/srfi-64/srfi-64.html).

A TAP output based unit testing framework that is in the spirit of SRFI-64 (http://srfi.schemers.org/srfi-64/srfi-64.html). The interface is similar and many procedures have the same names. However, skip and expected fail functionality are included into the tests themselves as keyword arguments instead of as separate procedures/macros. Additionally, the test-name argument has been moved to the end instead of being the first argument of each test macro, so as to better work with custom optional and keyword argument facilities. Another major difference is that test-begin's cannot be nested, though test-group-begin does add one level of nesting where all the tests within a group count as a single test for TAP output purposes (first one to FAIL or XPASS fails the whole group).

This library is Guile, R6RS, and R7RS compatible. The main source file src/unit-test-tap.scm is Guile specific (Common Lisp style docstrings and Guile specific module/library declaration), but R6RS and R7RS versions (src/r6rs/unit-test-tap.scm and src/r7rs/unit-test-tap.scm) are built from it as part of building this package. The one catch is that the R6RS and R7RS exception handling is used, which may not work with all exception types in some implementations, especially if they were not thrown with the R6RS or R7RS "raise" procedure.

INSTALL Instructions ===================================================

Generic instructions for configuring, compiling, and installing this library are in the INSTALL file. Specific instructions are detailed here.

The R6RS and R7RS-small versions have to be built from the Guile specific version. After being built, they are found at src/r6rs/unit-test-tap.scm and src/r7rs/unit-test-tap.scm.

The Guile version of the library is entirely contained in src/guile/unit-tap-test.scm. It is possible to just copy the file to where ever it is needed; such as into Guile's site directory, which can be found by running "(%site-dir)" at the REPL. On GNU/Linux, it will usually be something like /usr/share/guile/site/X.Y where X.Y is the effective version of Guile. Though, using the provided configure script and make will allow this to be done in a more automated fashion as well as compile to Guile's bytecode format (go files).

A configure script is provided that will produce a Makefile that can be used to build the R6RS and R7RS-small versions of the library, compile the library to Guile's bytecode format (go files), compile the library to Vicare's object format (fasl files), install the library into Guile's site directories for Scheme files and go files, install the library into Vicare's library search path, build the documentation, and run unit tests on the library in Guile, Chicken, and Vicare. The package is configured using the configure script, which takes user input to tune the build, finds and checks the desired Scheme implementations, and sets options for the different Scheme implementations. Inside the package directory, run

./configure [--prefix=DIR] [--with-guile=yes/no]] \
    [--with-guile-version=X.Y] \
    [--with-chicken=yes/no] [--with-vicare=yes/no]

where optional parameters can be used to set the base directory (prefix) for installing the documentation, which Scheme implementations to target (default is no for each one), and additional options for each Scheme implementation. The supported target implementations are guile (--with-guile), chicken (--with-chicken), and vicare (--with-vicare).

For Guile, the scheme source files can optionally be compiled with the --enable-guile-compile option (default is yes) and the Guile effective version to target can be specified with the --with-guile-version option (default is 2.2, followed by 2.0 if 2.2 cannot be found).

For Guile, the Guile effective version to target can be specified with the --with-guile-version option (default is 2.2, followed by 2.0 if 2.2 cannot be found).

Now that the Makefile has been made, one runs

make

to build the documentation in info format, compile the library to Guile's bytecode, and compile the library to Vicare's object format. The library can be checked by running unit tests on it (using Guile, Chicken, and/or Vicare) by running

make check

Everything can be installed by running.

make install

Installing the library itself is currently limited to just Guile and Vicare.

HTML documentation can be built using "make html" and installed by "make install-html".

If you grab unit-test-tap from its source code repository, configure will not be present yet. You need autoconf and automake in order to generate them. They are generated by running the command autoreconf.