Providing input for a test

The o option of RunTest allows you to specify options that RunTest and CreateTest ignore and pass on to your test. The o option allows you to pass arguments to your test classes. To give you flexibility, you can pass keyed and nonkeyed arguments to your class from the command line. Refer to "Setting up the environment" on page 37 for information on how to handle keyed and nonkeyed arguments you pass from the command line.

You precede keyed arguments with a text key. In this example, you pass an argument with the key -n that has a value of 333.

    RunTest -t TSampleObjectLengthTest SampleObjectTestLib -o -n 333
Note that -n follows the -o option. RunTest and CreateTest attempt to parse any information before the -o option. You will generate an error if you specify your information before the -o option.

This example shows how to pass a nonkeyed argument to your test class:

    RunTest -t TSampleObjectStringTest SampleObjectTestLib -o "This is a test"
The string is enclosed in quotation marks.

You can combine keyed and nonkeyed arguments:

    RunTest -t TSampleObjectStringTest SampleObjectTestLib -o -n 333 "This is a test"

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker