background image
<< Test Cases - Using object files | Test Cases - Recording from within a QA Organizer testplan >>
Test Cases - How object files are used
<< Test Cases - Using object files | Test Cases - Recording from within a QA Organizer testplan >>
User's Guide
135
5 D
ESIGNING
AND
R
ECORDING
T
ESTCASES
Using object files
Example Here's a simple example of how you might distribute object files
so that others cannot see the code.
In file test.inc, place the definition of a function called TestFunction. (When
you save the file, the entire include file is compiled into test.ino.)
TestFunction ()
ListPrint (Desktop.GetActive ())
In the file test.t use the test.inc include file. SilkTest and QA Partner will load
the .ino equivalent. Call TestFunction, which was defined in the include file
use "test.inc"
main ()
TestFunction () // call the function
Distribute test.t and test.ino. Users can open test.t and run it but do not have
access to the actual routine, which resides only in compiled form in test.ino.
How object files are
used
Object files are always used if they are available. When you open a script file
or an include file, the corresponding object file is loaded as well, if there is
one. If the object file is not older than the source file, the source file will not
be recompiled; the script is ready to run. If the source file is more recent, the
source file is recompiled before the script is run. If you then later save the
source, a new object file will be saved automatically.
If a file is loaded during compilation (that is, if a file is included in another
file that is being compiled), only the object file will be loaded, if it exists and
is newer than the corresponding source file.
Where object files are
located
By default, an object file is read from and written to the same directory as its
corresponding source file. But you can specify different directories for object
files.
Procedure To specify where object files should be written to and read from:
1
Select Options/Runtime.
The Runtime Options dialog is displayed.
2
Specify a directory in the Objfile Path field, as follows:
-
Leave the field empty if you want to store object files in the same
directory as their corresponding source files
-
Specify an absolute path if you want to store all object files in the
same directory
-
Specify a relative path if you want object files to be stored in a
directory relative to the directory containing the source files