background image
<< Porting Tests - Conditionally loading include files | Porting Tests - Supporting GUI-specific captions >>
Porting Tests - Supporting GUI-specific executables
<< Porting Tests - Conditionally loading include files | Porting Tests - Supporting GUI-specific captions >>
User's Guide
271
13 P
ORTING
T
ESTS
TO
O
THER
GUI
S
Supporting GUI-specific executables
Procedure To load different include files for different versions of the test
application:
1
Define a compiler constant, as described above. For example, you could
define a constant named
MyIncludeFile
.
2
Insert the following statement into your 4Test file:
use constant
For example, if you defined a constant MyIncludeFile, insert the
following statement:
use MyIncludeFile
Note In the above example, constant can also be an expression
that evaluates to a constant at compile time.
3
When you are ready to compile your 4Test files, specify the file name of
the include file you want loaded as the value of the constant in the
Compiler Constants dialog (be sure to enclose the value in quotation
marks if it is a string).
4
Compile your code.
SilkTest evaluates all compiler constants and substitutes their values for
the constants in your code. In this case, the constant
MyIncludeFile
will be evaluated to a file, which will be loaded through the use
statement.
Supporting GUI-specific executables
The command to start the application will almost always be different on each
GUI. SilkTest's Invoke method expects to find the command in the constant
sCmdLine, which is defined in your application's main window declaration.