KCMS Test Suite User's Guide

Creating Test Scripts

If the test scripts that are packaged with the KCMS DDK are not adequate to test specific features of your custom CMM, you may decide to edit them. If you make any changes (change the names of, add, or delete scripts from the list in icc.ini file or customize the contents of scripts), you may need to create an alternate initialization file or run selected scripts. For details, see Chapter 2, Running KCMS Test Scripts ," in this guide.

The test scripts you create must follow the guidelines for using KCMS functions as described in the SDK manual KCMS Application Developer's Guide. For example, to evaluate profiles used by your CMM, your script first must connect profiles. Prior to connecting profiles, it must create or load profiles. Keep in mind that the test suite can only test attributes it knows about. If your profiles use new attributes, the test scripts cannot test them. For examples of how to set attribute values, see Chapter 5, Setting Attributes .

Installing Scripts and Profiles

So that the kcmstest command can find them, you must install all test scripts in the kcmstest/script directory. Install all profiles you want to use in the test suite in the kcmstest/profiles directory. (See "Required File Hierarchy " for a description of the KCMS test suite directory hierarchy.) Note that this profile installation is a separate installation from the one to set up your CMM (described in "Setting Up Your CMM" .)


Note -

You may choose to install links to the location of your profiles.


Testing and Inspecting Results

Follow the guidelines for running the test scripts described in Chapter 2, Running KCMS Test Scripts . If you just plan to run a few scripts, you can use the kcms_qatest command with command options. See "Using kcmstest To Run Test Scripts" in Chapter 2. Alternately, if you plan to run a large batch of scripts, the chapter suggests that you use the automated test scripts to do so. See "Using Automated Script Files To Run Test Scripts" in Chapter 2.

Checking Status Codes

When you have run the scripts, inpect the log file(s).

In Chapter 2, "Running KCMS Test Scripts," Example 2-3 shows the log file output for the script shown in Example 2-2 in that same chapter. Status codes return the value 0 if a command completes successfully. Some scripts, however, expect an error to be returned. You can use the XStatus keyword to test for error conditions you expect to occur.

The IC_evalerr.scr test script, for example, creates test conditons in which the EVAL: command generates errors. The EVAL: command includes the optional keyword XStatus for reporting expected errors. Code example 5-1 is an excerpt from the IC_evalerr.scr script. The example shows two EVAL: commands that will generate errors because of incorrect or missing information. In each case, XStatus is set to the value 4024 ("KCS_PROF_NO_DATA_SUPPORT_4_REQUEST")

See Appendix A, Status Codes ," for a list of all the status strings and their values. You also can find status codes and strings in the header file kcsstats.h. For additional information on the meaning of status codes, see Chapter 6, "Warnings and Error Messages," in the SDK manual KCMS Application Developer's Guide.


Example 6-1 Using XStatus to Report Expected Errors

LOG:Attempt to evaluate
with a profile that does not have the correct transform;

EVAL:Reference=forward; 	SourcePixLayout=RGBInterLeaved;

	DestPixLayout=RGBInterLeaved; 	ImageIn=macbeth_1550.tif; 	ImageOut=None;

	Operation=Reverse; 	XStatus=4024; LOG:Attempt to evaluate an image with a

content not available in the profile; EVAL:Reference=simulate;

	SourcePixLayout=RGBInterLeaved; 	DestPixLayout=RGBInterLeaved;

	ImageIn=macbeth_1550.tif; 	ImageOut=None; 	Operation=Image;

	Operation=Reverse; 	XStatus=4024;