The kcmstest command is a test script interpreter that reads test scripts and performs the KCMS "C" API function calls based upon the commands in the test script.
To run test scripts with this command, you use the procedure described below. For details on kcmstest, see the manual page.
Be sure to set the KCMSROOT
environment variable before using the kcmstest command.
See "Environment Variables" for details.
The simplest way to start kcmstest is to type the following from a command shell and press Return.
%kcmstest
You are prompted with the following message:
Enter the script name to be executed or "quit" to exit Script Name(s)? |
You can enter the name of a script, for example IC_attrl.scr. Alternately, you can enter all, which executes all the scripts listed in icc.ini.
You must perform a few tasks manually to be able to run all the test scripts when you enter all. See the contents of the auto-kcmstest script for details.
When you run individual test scripts, an output log file is generated for each script. When you run all the scripts listed in icc.ini, a single log file is generated. See "Recording Test Script Results To a Log File" for details.
Use the test script auto-kcmstest to run the entire icc.ini test list. (See "Using Automated Script Files To Run Test Scripts".) The script creates certain setup files automatically.
From the command line, you can enter various options to the kcmstest command. Three frequently used options are -i, -h, and -s.
To specify your own initialization file, you can enter its name on the command line preceded by the -i option, for example
%kcmstest -i optional.ini
See "Creating An Alternate Initialization File" for details on alternate initialization files.
You can use the -s option to specify a script name (or all) and the -h option, to specify an alternate legal remote host name for scripts that test remote host access. The -h option attempts to pull a profile from the default directories on the remote host. Be sure that host has these directories and profiles.
The following example specifies the alternate initialization file alternate.ini, the script IC_attrl.scr, and the alternate host name dusk:
%kcmstest -i alternate.ini -s IC_attrl.scr -h dusk
The example below defaults to using the icc.ini file:
%kcmstest -s all
In this example, if any of the scripts in the icc.ini file access a remote host, the host name will be NULL and the scripts will fail.
As each of the test script commands is executed, information about the command that is currently being interpreted is displayed to the command shell window as well as written to a log file in the kcmstest/log directory.
For each script file executed, results are recorded in a log file. All the log files can be found in the kcmstest/log directory. The log file name is the name of the script file, with the .scr file extension replaced by the .log extension. If, for example, the test script name is IC_eval.scr, the log file name is IC_eval.log.
One exception to this naming scheme is if you enter all as the test script name. See "Starting the kcmstest Command" for details on this entry. In this case, the log file name is testall.log.
Two versions of a log file may exist at any given time: the current and the previous version. The previous version has its extension changed to .bak.
Example 2-3 is the log file output created from the test script shown in Example 2-2.
Parsing a KcsLoadProfile Command Profile Reference = scanner Profile File Name = kcmsEKls3510.inp Profile Handling = By File Profile Load Hint = LoadWhenNeeded; Profile Load Hint = UnLoadwhenNeeded; Profile Operation Hint = Image; Load Hint = 2024000 Thu Jul 25 08:16:07 1996 Completed KcsLoadProfile command, status = 0 Thu Jul 25 08:16:07 1996 Parsing a KcsLoadProfile Command Profile Reference = printer Profile File Name = kcmsEKsunnws.out Profile Handling = By File Profile Load Hint = LoadWhenNeeded; Profile Load Hint = UnLoadwhenNeeded; Profile Operation Hint = Image; Load Hint = 2024000 Thu Jul 25 08:16:07 1996 Completed KcsLoadProfile command, status = 0 Thu Jul 25 08:16:07 1996 Parsing a KcsConnectProfiles Command Profile Reference = scan-print Number of Profiles in Connect = 2 Profile Reference = scanner Profile Reference = printer Operation Hint = 20001 Thu Jul 25 08:16:07 1996 Completed KcsConnectProfiles command, status = 0 Thu Jul 25 08:16:08 1996 Parsing a KcsEvaluate Command Profile Reference = scan-print Source Layout = RGBInterLeaved; Destination Layout = RGBInterLeaved; Input Image Name = macbeth_1550.tif Output Image Name = None Operation Hint = 20001 Thu Jul 25 08:16:08 1996 Completed KcsEvaluate command, status = 0 364800.000000 pixels processed in 0.621338 seconds. The processing rate = 587120.062500 pixels/second. Parsing a Free Profile command Profile reference =scanner Completed KcsFreeProfile command, status = 0 Parsing a Free Profile command Profile reference = printer Completed KcsFreeProfile command, status = 0 Parsing a Free Profile command Profile reference = scan-print Completed KcsFreeProfile command, status = 0
If at any time during script execution, a KCMS framework API function call returns with an unexpected status code, the test is immediately aborted. For a list of all the status codes strings and their values, see Appendix A, Status Codes.
It may be your intention to have a status code returned that indicates an error because you deliberately set up a script to test an error condition. The script commands provide the optional keyword XStatus, which allows you to do this. For details, see the script command descriptions in Chapter 3, KCMS Test Suite Commands . Also see "Checking Status Codes".