TMPLTEST(1)
NAME
tmpltest - test template files
SYNOPSIS
tmpltest [-m] [-o ops] [-state[ops]] ... [-f file] templatefile
DESCRIPTION
Use tmpltest to test new or modified ClearDDTS template
files.
Sites will occasionally want to customize their ClearDDTS
template files to more fully meet their defect tracking
needs. Or, they may wish to greatly modify the ClearDDTS
methodology, which could require entirely new template
files. The tmpltest utility can be used to test those
template files.
The templatefile argument is the path name of the template
file to be executed.
By default, tmpltest does not preinitialize the STATE and
OPERATION fields, and the template file is executed exactly
once.
OPTIONS
-f file
This option specifies the name of a file, such as a
defect record file, to be used to initialize the
fields before running any of the templates. This is
especially useful when testing the master.tmpl file.
The specified file is used only for initializing
fields to be used in the template execution, so
tmpltest doesn't modify the original contents of the
file.
-m This option is for testing the "modem" mode (for slow
or non-screen oriented terminals). In this mode,
cursor motion commands in the template file are
ignored and prompts are printed to the screen one
after the other. The default is to use full-screen
mode.
-states
If one or more uppercase state letters is specified,
the templatefile is executed with the STATE field
preinitialized to each indicated letter in turn. If
there are multiple letters, the template file is
executed more than once.
-state[ops]
If an uppercase state letter is followed by ops, which
is an optional string of lowercase letters, the
OPERATION field is also preinitialized, and the
template file is executed with OPERATION set to each
letter and the STATE set to the same state letter.
For instance,
tmpltest -Nfp -Op my.tmpl
causes the template file my.tmpl to be executed three times:
first with STATE set to N and OPERATION set to f; next with
STATE set to N and OPERATION set to p; and finally with
STATE set to O and OPERATION set to p.
-o ops
This option causes tmpltest to act as if the specified
ops string were specified after each of the state
letters, so that the same group of operations are
performed for each state.
For instance, the command
tmpltest -ofpv -SNAORV my.tmpl
causes the template my.tmpl to be executed eighteen times,
as if the command:
tmpltest -Sfpv -Nfpv -Afpv -Ofpv -Rfpv -Vfpv my.tmpl
had been used. This example is the correct option set to
use when testing changes to the master.tmpl file. To also
test the "modify" operation for each state, you can add "m"
to the end of the list of operations in the -o option.
If -o is used and no state letters are specified, only the
OPERATION field is preinitialized, and the template file is
executed once for each lowercase letter in the ops string.
For instance -o fpvm would cause the template file to be
executed four times: first with OPERATION preinitialized to
f, next with OPERATION preinitialized to p, and so on.
When tmpltest is completely finished executing the template
file, it moves to the cursor to the bottom of the screen and
prints the results of the execution. The result consists of
lines of the form:
Fieldname: value
where Fieldname is the name of the field specified in the
template file and the value is the value that was last
derived for that field. This is the same format as used in
the defect record files, so this output shows what would
have ended up in the defect record file after executing that
template in the specified ways.
EXAMPLES
The following series of commands displays an index line for
the defect record file ABCaa02020, assuming it is in state
P:
cd ~ddts/class/software/user.index
tmpltest -m -f ~ddts/allbugs/20/ABCaa02020 P
Note that the -m option should be used for testing the
template files associated with adminbug(1), and for testing
the template files in the user.index and summary.print
directories, since these template files do not use cursor
motion.
Assuming you have write permission in the default template
directory, the following series of commands goes to that
directory, saves a copy of the record file for some defect
in state O, and demonstrates the way bugs(1) uses the
master.tmpl file to implement the R command. It uses the
same template to view the defect in the O state, paint an
empty form for the R fields on the same screen, move the
defect into the R state, and display the resulting defect
record now in the R state:
cd ~ddts/class/software
dumpbug -Rf XXXaa00303 > test.bug
tmpltest -Ov -Rfpv -f test.bug master.tmpl
rm test.bug
The defect record file XXXaa00303 is not changed by any of
these tests. To try out the above example, use the name of
some defect record in the O state.
FILES
~ddts/class/$Class/master.tmpl Master template
~ddts/allbugs/??/* Defect record files
SEE ALSO
bugmail(1), bugs(1), dumpbug(1), summarybug(1), template(5),
dfile(5), ClearDDTS Administrator's Guide