ipp -- test CS3 individual programming project work.
ipp [-1|-2] [options] ipp1 [options] ipp2 [options]
ipp program will check a µOCCAM compiler written for the
CS3 individual programming project, applying tests provided by the user.
To enable the script, extend your search path using the command
The program makes the following preliminary checks.
makein the source directory must run without error.
If any of these fails,
ipp prints an appropriate error message
and terminates. Otherwise, it runs the created µOCCAM compiler on sample
files provided in a separate test directory. These files have the following
different forms, indicated by the extension part of their names.
||Valid occam code that the compiler should accept.|
||Illegal occam code that the compiler should reject.|
||A valid occam program to be compiled and run.|
||Input for the corresponding |
||Correct output for |
||Brief text describing the |
<test>.io. file must have matching
<test>.out files. The
<test>.comment files are optional.
While running, ipp writes a two-line report to standard output.
ipp2: ++**---//---//-/!!?! ipp2: Passed 12 of 20 tests
ipp2" indicates the directory containing the
occam program. The first line has one character for the
outcome of each test:
+valid program correctly accepted
*valid program incorrectly rejected
-invalid program correctly rejected
/invalid program incorrectly accepted
!I/O program produced correct output
?I/O program produced incorrect output
%I/O program incorrectly rejected
^compiler aborted or exceeded time limit.
The second line summarises the results. A separate log file
ipplog records detailed information about performance on all
Several options exist to control how the program operates. Most have default values, which may also be given by environment variables. If an option is repeated, the last occurrence takes priority.
Determines the relevant stage of the practical. This can also be fixed
using the name by which the program is invoked:
ipp2. There is no default value: if no stage can be
ipp terminates with an error message.
For stage 1, the occam compiler is expected to read a program from
its standard input and performs syntactic checking only. None of the
I/O tests are used. In stage 2, the occam compiler is given a file
name, and I/O tests are included. For simple accept/reject tests in
stage 2 the compiler is given the "
switch to prevent running compiled code.
Directory containing source code for the occam compiler, and a suitable
Makefile. Default is "
ipp1" or "
depending on the stage.
Directory containing all the test files. Default
File to record detailed report on tests. This is in addition to the
two-line diagnostic described earlier. Default "
Maximum CPU time in seconds given to the occam compiler for each test.
ulimit function is used to cut off any program from
taking too long. Default value 2 seconds.
Each of the options above has a corresponding environment variable.
|IPPSTAGE||Stage of practical, 1 or 2.|
|IPPDIR||Directory for compiler source code.|
|IPPTESTS||Directory for test µOCCAM programs.|
|IPPLIMIT||CPU time limit per test, in seconds.|
||Directories for compiler source code.|
||Executable program in |
||µOCCAM test programs|
|Record of test results.|
The log file contains the following information.
occamon test file.
If the preliminary checks fail, the program returns the error code 1. Otherwise, it returns 0 to indicate success, regardless of how well the compiler performs on the individual tests.
The program makes no check to see whether the test files provided by the user actually are valid or invalid occam programs as claimed.