|
|
1.1 root 1: .TH PTEST 1P "22 June 1983"
2: .UC 4
3: .SH NAME
4: ptest \- test a project module
5: .SH SYNOPSIS
6: .B ptest
7: [\fB\-d\fR] [\fB\-F \fRtemplate] [\fB\-P \fRprojectname] [module ...]
8: .SH DESCRIPTION
9: .I Ptest
10: does regression testing on project
11: .I modules.
12: Individual modules can be selected for testing, or if
13: .I ptest
14: is given without
15: .I module
16: arguments, all of the modules in a project are tested. Modules can be
17: programs, libraries, or functions.
18: .PP
19: For each module to be tested there must exist an archive containing
20: a test program, input data, and test results.
21: .I Ptest
22: tests a module by extracting the archive, compiling the test program,
23: executing the test, and comparing the output with expected test results using
24: the
25: .I diff
26: program:
27: .PP
28: T\fItest\fR < I\fItest\fR | diff \- O\fItest\fR
29: .PP
30: where
31: .I test
32: is the name of the module test. If the test output differs from
33: expected results, the test fails and error diagnostics are saved in a
34: file named `E\fItest\fR'.
35: .PP
36: .B "Compiling The Test Program"
37: .PP
38: If an archive contains a compilable test program,
39: .I ptest
40: uses
41: .I mkmf
42: to edit the file name of the test program into a makefile which is then used by
43: .I make
44: to compile the program. If there are other source code file names in
45: the current working directory, these are also included in the
46: makefile. This mechanism allows experimental versions of functions to
47: be tested since they will override any other occurrences of the
48: functions (e.g. in a library).
49: .PP
50: .B "Creating Test Archives"
51: .PP
52: Archives containing module tests reside in the `test' directory located
53: in the project root directory. Each archive must be created by the
54: .I ar
55: command and given the name \fItest\fR.a where
56: .I test
57: is the name of a module test. These archives include the following files:
58: .IP (a)
59: `T\fItest.lang\fR' test program source code. The file name suffix,
60: .I lang,
61: identifies the programming language in which the test program is written.
62: .IP (b)
63: `T\fItest\fR.sh' shell command script. `T\fItest\fR.sh' executes a test and
64: compares the test output with expected results stored in the archive.
65: If the output matchs expected results, `T\fItest\fR.sh' returns with
66: exit code 0. If the results differ, the exit code should be non-zero.
67: .IP
68: Note: the shell command script must be made executable by doing:
69: .IP
70: chmod +x T\fItest\fR.sh
71: .IP
72: If a `T\fItest\fR.sh' file is not found in the archive,
73: .I ptest
74: executes the following command:
75: .IP
76: T\fItest\fR < I\fItest\fR | diff \- O\fItest\fR
77: .IP
78: or if there is no `I\fItest\fR' data file:
79: .IP
80: T\fItest\fR | diff \- O\fItest\fR
81: .IP (c)
82: `I\fItest\fR' data file for test input.
83: .IP (d)
84: `O\fItest\fR' data file for validated test output. The output from a module
85: test will be compared against the information in this file. If no output
86: is expected, this file should be zero size.
87: .PP
88: The files `T\fItest.lang\fR', `T\fItest\fR.sh', and `I\fItest\fR' may be omitted
89: from the archive.
90: .SH OPTIONS
91: .IP \fB\-d\fR
92: Leave the files that have been extracted from an archive, in the current
93: directory for debugging purposes.
94: .IP "\fB\-F \fItemplate\fR"
95: Specify an alternative makefile
96: .I template
97: file name. The default file name is `t.Makefile'.
98: .IP "\fB\-P \fIprojectname\fR"
99: Specify a project other than the current working project.
100: .SH FILES
101: .ta \w'/usr/new/lib/t.Makefile'u+.5i
102: .nf
103: /usr/new/lib/t.Makefile Standard test program makefile template.
104: \fIproject\fR/lib/t.Makefile User-defined test program makefile template.
105: \fIproject\fR/test/*.a Project test archives.
106: \fItest\fR.a Module test archive.
107: E\fItest\fR Module error diagnostic file.
108: I\fItest\fR Module input data file.
109: O\fItest\fR Module validated output data file.
110: T\fItest\fR Compiled module test program.
111: T\fItest\fR.sh Module shell command script.
112: T_makefile Test program makefile.
113: .DT
114: .fi
115: .SH "SEE ALSO"
116: ar(1), chmod(1), diff(1), make(1), mkmf(1P)
117: .SH DIAGNOSTICS
118: Exit status 0 if the test succeeds. Exit status 1 if it fails.
119: .SH AUTHOR
120: Peter J. Nicklin
121: .SH BUGS
122: Since the PATH environment variable governs the order in which directories
123: are searched for executable commands, the production version of a command
124: may be used instead of an experimental version.
125: .PP
126: Any files beginning with `T' (except those with suffix `.sh') are deleted
127: prior to each test.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.