((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/testdrive" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "testdrive" (p "Driver program for continuous integration scripts.") (toc)) (section 2 "Usage" (p "testdrive [options...] [commands...]")) (section 2 "Documentation" (p (tt "testdrive") " is a simple program for running a set of compilation and testing scripts with a single command. For each module defined in the configuration file, " (tt "testdrive") " looks for a fetch script, build script, test script, and plot script. After these scripts have been run successfully, it constructs an HTML file with the results of all tests and any images generated by the plot script. Additionally, the configuration file can define variables that are expanded in the script files before they are run.") (section 3 "Order of operations" (p "Given a configuration file " (tt "testdrive") " performs the following operations for each module defined:") (ol (li "change directory to the configuration directory for the current module;") (li "obtain the latest revision: using either the command specified in the configuration file or a script named `revisions'; this script is called with the module name as argument;") (li "fetch the module source code: using either the command specified in the configuration file or a script named `fetch'; this script is called with the module name, latest revision, and build location as arguments;") (li "build the module in the build location: either the command specified in the configuration file or a script named `build'; this script is called with the module name and build location as arguments;") (li "run the module tests: either the command specified in the configuration file or all scripts contained in subdirectory `tests'; this script is called with the module name and build location as arguments;") (li "produce module plots: the command specified in the configuration file or a script named `plots'; this script is called with the module name and build location as arguments;") (li "cleanup: (optional) command specified in the configuration file or a script named `cleanup'; if it exists this script is called with the module name and build location as arguments;")) (section 4 "Expansion of variables in the script files" (p "If the configuration file specifies an environment for the scripts (see next section), then before any of the scripts are run, text of the form " (tt "VARIABLE") " will be expanded to the corresponding value given in the configuration file.")) (section 4 "Example script files" (ul (li "revisions script")) (highlight bash "#!/bin/sh\n# revisions.sh: A script to obtain the latest revision of a file in SVN\nsvn info --username=anonymous --password=''   https://code.call-cc.org/svn/file.scm | grep Revision: | cut -f2 -d:") (ul (li "fetch script")) (highlight bash "#!/bin/sh\n# fetch.sh: A script to obtain a file of the given revision from SVN\nMODULE_NAME=$1\nVERSION=$2\nBUILD_DIR=$3\nsvn export --username=anonymous --password='' -r $VERSION  https://code.call-cc.org/svn/file.scm $BUILD_DIR/file.scm") (ul (li "build script")) (highlight bash "#!/bin/sh\n# build.sh: A script to build a module\nMODULE_NAME=$1\nBUILD_DIR=$2\nCHICKEN_DIR={{CHICKEN_DIR}}\ncd $BUILD_DIR\n$CHICKEN_DIR/bin/csc -o file file.scm") (ul (li "test script")) (highlight bash "#!/bin/sh\n# run.sh: A module test script\nMODULE_NAME=$1\nBUILD_DIR=$2\ncd $BUILD_DIR\n./file > test.dat") (ul (li "plot script")) (highlight scheme "#! {{CHICKEN_DIR}}/bin/csi -script\n;; plot.scm: A module plot script\n(use srfi-1 posix ploticus)\n\n(define (plot-log ... ))\n\n(let ((args (command-line-arguments)))\n\n  (let (\n\t(model-name (first args))\n\t(build-dir (second args))\n\t)\t   \n\t\t\t\n    (plot-log \"test.dat\" build-dir)\n    ))"))) (section 3 "Configuration file format" (p "The configuration file is loaded in the Scheme interpreter; i.e. it is a regular Scheme program which has access to two parameters specific to " (tt "testdrive") ": " (tt "env") " and " (tt "modules") ".") (p (tt "env") " is an alist of variables which will be substituted in model scripts. " (tt "modules") " is the list of modules, wheter each element is of the form:") (pre " (module-id  (label . \"Module label\") (config-path . \"/home/testdrive/module\"))") (p (tt "module-id") " must be replaced by a unique identifier for this module. " (tt "label") " is a descriptive label which will be used in the generated HTML report. " (tt "config-path") " is the location of configuration scripts for this module.") (section 4 "Example configuration" (pre "\n (define module-source-dir \"/home/user/src/modules\")\n\n (env `(\n      (CHICKEN_DIR . \"$HOME/bin/chicken\")\n      ))\n\n (modules `(\n  (test_module\n   (label . \"Test module\")\n   (config-path  . ,(make-pathname module-source-dir \"test\")))\n  ))\n")))) (section 2 "About this egg" (section 3 "Author" (p (int-link "/users/ivan-raikov" "Ivan Raikov"))) (section 3 "Version history" (dl (dt "1.4-1.5") (dd "Generation of several tables sorted by property") (dt "1.3") (dd "Table format for index page") (dt "1.1-1.2") (dd "Bug fix releases") (dt "1.0") (dd "Initial release"))) (section 3 "Requirements" (ul (li (int-link "ersatz")) (li (int-link "uri-generic")) (li (int-link "matchable")) (li (int-link "regex")))) (section 3 "License" (pre "Copyright 2013-2016 Ivan Raikov.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nA full copy of the GPL license can be found at\n<http://www.gnu.org/licenses/>."))))