.\" Automatically generated by Pod::Man version 1.02 .\" Tue Nov 21 19:38:09 2000 .\" .\" Standard preamble: .\" ====================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used .\" to do unbreakable dashes and therefore won't be available. \*(C` and .\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` ` . ds C' ' 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr .\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and .\" index entries marked with X<> in POD. Of course, you'll have to process .\" the output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" . . . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it .\" makes way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. .bd B 3 . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ====================================================================== .\" .IX Title "CONS-TEST 1" .TH CONS-TEST 1 "2.2.0" "2000-11-21" "Cons-Test - Regression Tests for Cons" .UC .SH "NAME" cons-test \- Run Cons tests .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& cons-test [-qw] [-d dir] [-I dir] [-x cons] [test_script ...] .Ve .Vb 5 \& -d dir search for tests in specified dir \& -I dir add dir to Perl search path \& -q quiet, supress warnings about undefined variables \& -w execute the cons script with perl -w flag \& -x cons test specified cons script .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" By default, the \f(CW\*(C`cons\-test\*(C'\fR script will test the script \f(CW\*(C`cons\*(C'\fR or \&\f(CW\*(C`cons.pl\*(C'\fR in the current directory. .PP An alternate \f(CW\*(C`cons\*(C'\fR script name may be specified via the \f(CW\*(C`\-x\*(C'\fR flag: .PP .Vb 1 \& $ cons-test -x cons.NEW .Ve .Vb 1 \& $ cons-test -x /usr/foo/cons.experiment/cons .Ve The \f(CW\*(C`cons\-test\*(C'\fR script will arrange for each test to use the specified \&\f(CW\*(C`cons\*(C'\fR script. The \f(CW\*(C`cons\*(C'\fR script under test need not have execute permission set. .PP The \f(CW\*(C`cons\*(C'\fR script under test may be executed with the Perl \f(CW\*(C`\-w\*(C'\fR flag, which warns about conditions such as uninitialized variables: .PP .Vb 1 \& $ cons-test -w .Ve By default, the \f(CW\*(C`cons\-test\*(C'\fR script executes all the tests it finds in the following directories: .PP .Vb 4 \& . \& t \& /usr/lib/cons-2.2.0/test/t \& /usr/lib/cons/test/t .Ve Any file with a \f(CW\*(C`.t\*(C'\fR extension is assumed to be a test. The \f(CW\*(C`cons\-test\*(C'\fR script can also execute tests with \f(CW\*(C`.pl\*(C'\fR or \f(CW\*(C`.sh\*(C'\fR extensions, although they must be explicitly listed on the command line. .PP By default, the executed tests use the supporting \f(CW\*(C`Test::Cmd\*(C'\fR and \&\f(CW\*(C`Test::Cmd::Cons\*(C'\fR perl modules found under the current directory or \&\fI/usr/lib/cons-2.2.0\fR. Additional directories to be searched for these modules may be specified with \f(CW\*(C`\-I\*(C'\fR flag. .PP Each test is executed with the specified \f(CW\*(C`cons\*(C'\fR script passed in via the \f(CW\*(C`CONS\*(C'\fR environment variable. The \f(CW\*(C`cons\*(C'\fR script will be executed with any Perl flags specified via the \f(CW\*(C`PERLFLAGS\*(C'\fR environment variable. .PP After all the tests have been executed, the \f(CW\*(C`cons\-test\*(C'\fR script reports a summary of the pass/fail score: .PP .Vb 1 \& cons-test: 'cons' passed all 130 tests. .Ve .Vb 3 \& cons-test: 'cons' passed 128 tests, failed 2: \& /usr/lib/cons-2.2.0/test/t/t0003.t \& /usr/lib/cons-2.2.0/test/t/t0026.t .Ve The \f(CW\*(C`cons\-test\*(C'\fR script can be given one or more tests as arguments, in which case it will only execute the specified tests: .PP .Vb 5 \& $ perl cons-test t0007.t t0023.t \& cons-test: perl -w /usr/lib/cons-2.2.0/test/t/t0007.t \& PASSED \& cons-test: perl -w /usr/lib/cons-2.2.0/test/t/t0023.t \& PASSED .Ve .Vb 2 \& cons-test: 'cons' passed all 2 tests. \& $ .Ve The \f(CW\*(C`cons\-test\*(C'\fR script may also be given environment variable assignments as arguments. These will be evaluated in order with the test arguments. This allows, for example, executing the same \fItest\fR\|(s) with different compilers in the same \f(CW\*(C`cons\-test\*(C'\fR invocation: .PP .Vb 10 \& $ perl cons-test CC=gcc t/t0001.t CC=no_compiler t/t0001.t \& cons-test: perl -w /usr/lib/cons-2.2.0/test/t/t0001.t \& PASSED \& cons-test: perl -w /usr/lib/cons-2.2.0/test/t/t0001.t \& FAILED test #1 of cons [single-module Program]: \& no_compiler -c foo.c -o foo.o \& cons: failed to execute "no_compiler" (No such file or directory). Is this an executable on path "/bin:/usr/bin"? \& cons: *** [foo.o] Error 2 \& cons: errors constructing foo.o \& FAILED test #1 of cons [single-module Program] .Ve .Vb 3 \& cons-test: 'cons' passed 1 tests, failed 1: \& /usr/lib/cons-2.2.0/test/t/t0001.t \& $ .Ve By default, the \f(CW\*(C`cons\-test\*(C'\fR script expects that the environment variables \&\f(CW\*(C`CC\*(C'\fR, \f(CW\*(C`AR\*(C'\fR, and \f(CW\*(C`RANLIB\*(C'\fR are set, and will generate warnings if they are not. A \f(CW\*(C`\-q\*(C'\fR option may be used to suppress these warnings. .SH "TESTS" .IX Header "TESTS" Tests conform to requirements of the Aegis project change supervisor, which integrates creation and execution of regression tests into the software development process. Information about Aegis can be found at: .PP .Vb 1 \& http://www.tip.net.au/~millerp/aegis.html .Ve Each test is a completely self-contained Perl script, and may be directly executed by explicitly passing it to perl (\f(CW\*(C`\-w\*(C'\fR flag preferred): .PP .Vb 1 \& $ perl -w t/t0001.t .Ve The cryptic names are by Aegis convention only, and could have been named to reflect the functionality being tested. The numbering has been preserved to try to give order to the tests: Simpler, underlying functionality is tested before more complicated features that rely on functionality tested by prior tests. .PP Each test creates a temporary work directory under \f(CW\*(C`$TMPDIR\*(C'\fR (under \&\fI/tmp\fR by default) and populates it with files from in-line here documents. .PP Each test checks the return value from every subroutine it calls and ever command it executes, expecting a successful return value or exit code from each. When it's important, each test compares actual command output against expected output. Note that, in the usual case, this is actually output of the executables generated by Cons, not the \*(L"cc\*(R" command lines reported as the actions Cons executes to build the test executables. There are some exceptions, tests which do examine the build actions; these are noted in the \f(CW\*(C`Tests.txt\*(C'\fR file and in the commentary at the top of each test. .PP By default, the tests rely on having normal C compilation, linking and archiving tools available through the environment's \f(CW\*(C`PATH\*(C'\fR, and expect that \f(CW\*(C`printf()\*(C'\fR is available through whatever library is linked into a program via the default Cons build environment. These tests use the following environment variables for specification of alternate paths to various utilities: .PP .Vb 3 \& AR (default: 'ar') library archiver \& CC (default: 'cc') C compiler \& RANLIB (default: 'ranlib') ranlib .Ve As described previously, the \f(CW\*(C`cons\-test\*(C'\fR script accepts environment variable assignments in its command-line arguments. This may be used, for example, to specify different C compilers for different test invocations: .PP .Vb 1 \& $ perl cons-test CC=gcc t/t0001.t CC=cc t/t0001.t .Ve Each test reports one of three results: .Ip "\s-1PASSED\s0" 4 .IX Item "PASSED" The Cons script being tested passed this test. .Ip "\s-1FAILED\s0 test of [functionality]" 4 .IX Item "FAILED test of [functionality]" The Cons script being tested failed this test. .Ip "\s-1NO\s0 \s-1RESULT\s0 for test of [functionality]" 4 .IX Item "NO RESULT for test of [functionality]" The Cons script could not be tested due to some non-Cons problem (e.g., unable to create temporary directory or file). .PP Each test removes its temporary work directory upon completion. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" For post facto debugging, the work directory can be preserved (and its name reported) by setting environment variables: .Ip "\s-1PRESERVE\s0" 4 .IX Item "PRESERVE" Don't remove the work directory. .Ip "\s-1PRESERVE_PASS\s0" 4 .IX Item "PRESERVE_PASS" Don't remove the work directory if the test passes. .Ip "\s-1PRESERVE_FAIL\s0" 4 .IX Item "PRESERVE_FAIL" Don't remove the work directory if the test fails. .Ip "\s-1PRESERVE_NO_RESULT\s0" 4 .IX Item "PRESERVE_NO_RESULT" Don't remove the work directory if there is no valid test result. .SH "FILES" .IX Header "FILES" .Ip "/usr/lib/cons-2.2.0/test/Test/Cmd/Cons.pm" 4 .IX Item "/usr/lib/cons-2.2.0/test/Test/Cmd/Cons.pm" Perl module for testing Cons. .Ip "/usr/lib/cons-2.2.0/test/Tests.txt" 4 .IX Item "/usr/lib/cons-2.2.0/test/Tests.txt" Summary descriptions of all tests. .Ip "/usr/lib/cons-2.2.0/test/t/" 4 .IX Item "/usr/lib/cons-2.2.0/test/t/" Subdirectory containing the default set of tests. .SH "AUTHOR" .IX Header "AUTHOR" Steven Knight .SH "REPORTING BUGS" .IX Header "REPORTING BUGS" Report bugs to . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2000 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is \s-1NO\s0 warranty; not even for \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. .SH "SEE ALSO" .IX Header "SEE ALSO" the cons manpage