background image
<< Porting Tests - With global variables | Porting Tests - Conditionally loading include files >>
Porting Tests - Conditional compilation
<< Porting Tests - With global variables | Porting Tests - Conditionally loading include files >>
User's Guide
269
13 P
ORTING
T
ESTS
TO
O
THER
GUI
S
Conditional compilation
Conditional compilation
If you have GUI-specific code in your scripts and declarations, you can have
SilkTest conditionally compile your code based on the values of the GUI
specifiers--only code specific to a particular GUI is compiled (as well, of
course, as all code that is not GUI-specific). This has two advantages:
·
The compilation is faster
·
The resulting code is smaller and require less memory to run
You can also cause conditional compilation by using constants, which are
evaluated at compile time.
Note Constants are not restricted to conditional compilation. You
can use constants for any value that you want resolved at compile
time.
Procedure To conditionally compile code:
1
Prefix any 4Test statements that are GUI-specific with the appropriate
GUI specifier, as described in the previous section.
2
Specify the platforms that you want to compile for by entering the
appropriate GUI specifiers in the GUI Targets field in the Runtime
Options dialog. You can specify as many GUI targets as you want;
separate each GUI specifier by a comma.