Reactis API V2022
Reactis API (C Bindings):
Reactis Tester
rsTester
Create a test suite.
Syntax
RsTestSuite *rsTester (
RsHandle *h,
const char *modelFileName,
const char *infoFileName,
const char *testSuiteFileName,
const char *params
);
Parameters
- h
- Pointer to RsHandle structure as returned by rsOpen.
- modelFileName
- Path and name of model file (.mdl file).
- infoFileName
- Path and name of Reactis info file (.rsi file) associated with the
model. Can be NULL, in which case no info file will be used.
- testSuiteFileName
- Path and name of the resulting test suite file (.rst file). The file must
be writable and will be overwritten if it already exists. testSuiteFileName
can be NULL in which case a temporary file will be created which will be
deleted when calling rsSuiteClose.
- params
- A string containing parameters for test-suite generation. The format
of the string is described in Tester Additional Parameters.
Return Value
Pointer to a RsTestSuite structure that can be used to run it in a
Simulator session. NULL, if Reactis Tester failed. In that case, call
rsGetLastError to retrieve the error message string.
rsTesterWithReport
Create a test suite and a test execution report.
Syntax
RsTestSuite *rsTesterWithReport (
RsHandle *h,
const char *modelFileName,
const char *infoFileName,
const char *testSuiteFileName,
const char *params,
const char *reportFileName,
const RsReportConfig *reportConfig
);
Parameters
(Note that the first four parameters below are the same as for function
rsTester.)
- h
- Pointer to RsHandle structure as returned by rsOpen.
- modelFileName
- Path and name of model file (.mdl file).
- infoFileName
- Path and name of Reactis info file (.rsi file) associated with the
model. Can be NULL, in which case no info file will be used.
- testSuiteFileName
- Path and name of the resulting test suite file (.rst file). The file must
be writable and will be overwritten if it already exists. testSuiteFileName
can be NULL in which case a temporary file will be created which will be
deleted when calling rsSuiteClose.
- params
- A string containing parameters for test-suite generation. The string may
include one or more of the following flags. All are optional.
- -a 0|1
- Turns input abstraction on (1) or off (0). Inputs abstraction usually improves the performance of Tester and should be left on (default). In rare cases, turning it off may improve coverage. If coverage problems are encountered with inputs abstraction on, it may be beneficial to take a test suite produced with abstraction on, pre-load it into Tester, turn abstraction off, and then run Tester again.
- -g c1;c2;...;cN
- Specify a list of criteria that should be used to guide test suite
generation. See Coverage Metric Names for details. For a detailed
description on coverage criteria in Reactis please refer to Chapter
6.
- -p fName1=y|n;fName2=y|n;...;fNamei=y|n
- Specify a list of .rst files to pre-load. The y|n argument for each file
specifies whether or not pruning of the suite should be allowed. The
random and targeted phases will extend the preloaded tests. The preloaded
test suite files will not be modified.
- -q timeoutSeconds
- Specify the number of seconds for which to produce test cases. Tester
will stop after either the timeout expires, all steps in the random
or targeted phases have been executed, or full coverage is achieved for
the model, whichever comes first. If -q is given and -t is not given, then
Tester will continue until either the timeout expires or full coverage is
achieved.
- -r numTests;numSteps
- Specify the number of tests and steps in the random phase. The defaults
are 5 tests of 1000 steps each.
- -s randomSeed
- Initial seed for the random number generator.
- -t stepsInTargetedPhase
- stepsInTargetedPhase specifies the number of execution steps to take
during the targeted phase of test generation. The default is 20,000
steps.
- reportFileName
- Path and name of the resulting test execution report file. The file must be
writable and will be overwritten if it already exists. The format of the
file is determined by the extension. Currently, an extension of .htm or
.html results in HTML data.
- reportConfig
- Determines what information is included in the test execution report. If
reportConfig is NULL, then a default configuration is used,
which currently includes everything in the report except MCC target
information.
Return Value
Pointer to a RsTestSuite structure that can be used to run it in a
Simulator session.
NULL, if Reactis Tester failed. In that case, call rsGetLastError
to retrieve the error message string.
rsTesterStart
Initiate the asynchronous creation of a test suite.
Initiates creation of a test suite. This function is similar to
rsTester but returns immediately after initiating the creation of the
test suite. Reactis Tester will keep running in the background after this
function returns. Use the access functions rsTesterGetProgress,
rsTesterGetStatus and rsTesterIsRunning to get the progress and
status of the running Tester instance. Use the function
rsTesterGetSuite to get the test suite created after Tester has
finished. Use the function rsTesterStop to stop a Tester session. Use
the function rsTesterClose to close a Reactis Tester instance.
Syntax
rsTester *rsTesterStart (
RsHandle *h,
const char *modelFileName,
const char *infoFileName,
const char *testSuiteFileName,
const char *params
);
Parameters
(Note that the parameters below are the same as for function rsTester.)
- h
- Pointer to RsHandle structure as returned by rsOpen.
- modelFileName
- Path and name of model file (.mdl file).
- infoFileName
- Path and name of Reactis info file (.rsi file) associated with the
model. Can be NULL, in which case no info file will be used.
- testSuiteFileName
- Path and name of the resulting test suite file (.rst file). The file must
be writable and will be overwritten if it already exists. testSuiteFileName
can be NULL in which case a temporary file will be created which will be
deleted when calling rsSuiteClose.
- params
- A string containing parameters for test-suite generation. The format
of the string is described in Tester Additional Parameters.
Return Value
Pointer to a RsTester structure that must be used in all subsequent calls
to the functions rsTesterGetStatus, rsTesterGetSuite,
rsTesterIsRunning , rsTesterStop and rsTesterClose. NULL,
if Reactis Tester failed to start. In that case, call rsGetLastError
to retrieve the error message string.
rsTesterStartWithReport
Initiate the asynchronous creation of a test suite and report.
Initiates creation of a test suite with report generation. This function is
similar to rsTesterStart, with a test execution report produced as an
additional output. Like rsTesterStart, this function returns
immediately after initiating the creation of the test suite. Reactis Tester
will keep running in the background after this function returns. Use the
access functions rsTesterGetProgress, rsTesterGetStatus and
rsTesterIsRunning to get the progress and status of the running
Tester instance. Use the function rsTesterGetSuite to get the test
suite created after Tester has finished. Use the function
rsTesterStop to stop a Tester session. Use the function
rsTesterClose to close a Reactis Tester instance.
Syntax
rsTester *rsTesterStartWithReport (
RsHandle *h,
const char *modelFileName,
const char *infoFileName,
const char *testSuiteFileName,
const char *params,
const char *reportFileName,
const RsReportConfig *reportConfig
);
Parameters
(Note that the first four parameters below are the same as for function
rsTesterStart.)
- h
- Pointer to RsHandle structure as returned by rsOpen.
- modelFileName
- Path and name of model file (.mdl file).
- infoFileName
- Path and name of Reactis info file (.rsi file) associated with the
model. Can be NULL, in which case no info file will be used.
- testSuiteFileName
- Path and name of the resulting test suite file (.rst file). The file must
be writable and will be overwritten if it already
exists. testSuiteFileName can be NULL in which case a temporary
file will be created which will be deleted when calling rsSuiteClose.
- params
- A string containing parameters for test-suite generation. The string may
include one or more of the following flags. All are optional.
- -a 0|1
- Turns input abstraction on (1) or off (0). Inputs abstraction usually
improves the performance of Tester and should be left on (default). In
rare cases, turning it off may improve coverage. If coverage problems are
encountered with inputs abstraction on, it may be beneficial to take a
test suite produced with abstraction on, pre-load it into Tester, turn
abstraction off, and then run Tester again.
- -g c1;c2;...;cN
- Specify a list of criteria that should be used to guide test suite
generation. See Coverage Metric Names for details. For a detailed
description on coverage criteria in Reactis please refer to Chapter
6.
- -p fName1=y|n;fName2=y|n;...;fNamei=y|n
- Specify a list of .rst files to pre-load. The y|n argument for each file
specifies whether or not pruning of the suite should be allowed. The
random and targeted phases will extend the preloaded tests. The preloaded
test suite files will not be modified.
- -q timeoutSeconds
- Specify the number of seconds for which to produce test cases. Tester
will stop after either the timeout expires, all steps in the random
or targeted phases have been executed, or full coverage is achieved for
the model, whichever comes first. If -q is given and -t is not given, then
Tester will continue until either the timeout expires or full coverage is
achieved.
- -r numTests;numSteps
- Specify the number of tests and steps in the random phase. The defaults
are 5 tests of 1000 steps each.
- -s randomSeed
- Initial seed for the random number generator.
- -t stepsInTargetedPhase
- stepsInTargetedPhase specifies the number of execution steps to take
during the targeted phase of test generation. The default is 20,000
steps.
- reportFileName
- Path and name of the resulting test execution report file. The file must be
writable and will be overwritten if it already exists. The format of the
file is determined by the extension. Currently, an extension of .htm or
.html results in HTML data.
- reportConfig
- Determines what information is included in the test execution report. If
reportConfig is NULL, then a default configuration is used,
which currently includes everything in the report except MCC target
information.
Return Value
Pointer to an RsTester structure that must be used in all subsequent calls
to the functions rsTesterGetStatus, rsTesterGetSuite,
rsTesterIsRunning, rsTesterStop and rsTesterClose. NULL,
if Reactis Tester failed to start. In that case, call rsGetLastError
to retrieve the error message string.
rsTesterStop
Stop running asynchronous test suite creation.
Stops the Reactis Tester instance given as a parameter.
rsTesterGetSuite can still be called after this and will
return the (incomplete) test suite.
Syntax
void rsTesterStop (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with
rsTesterStart.
Return Value
None.
rsTesterClose
Close a Reactis Tester session.
Closes the Reactis Tester instance given as a parameter. The pointer
passed as a parameter will be invalid after this call.
Syntax
void rsTesterClose (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with
rsTesterStart.
Return Value
None.
rsTesterIsRunning
True if test suite creation is still ongoing.
Determines if a Reactis Tester instance is still running.
Syntax
int rsTesterIsRunning (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with
rsTesterStart.
Return Value
1 if the Reactis Tester instance given as a parameter is still running
and 0 otherwise.
rsTesterGetProgress
Get test suite generation progress.
Queries the progress of a Reactis Tester instance.
Syntax
double rsTesterGetProgress (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with
rsTesterStart.
Return Value
A number between 0 and 100 to indicate the progress of the Reactis
Tester instance given as a parameter (similar to the progress indicator in
the Tester dialog within the Reactis GUI).
rsTesterGetStatus
Get test suite generation status.
Queries the status of a Reactis Tester instance.
Syntax
const char *rsTesterGetStatus (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with
rsTesterStart.
Return Value
A string indicating the current status of the Reactis Tester instance
given as a parameter (similar to the status field in the Tester dialog
within the Reactis GUI).
rsTesterGetSuite
Get test suite after generation is finished.
Gets the test suite generated by a Reactis Tester instance.
Syntax
RsTestSuite *rsTesterGetSuite (RsTester *tester);
Parameters
- tester
- Pointer to an RsTester instance which was previously started with rsTesterStart.
Return Value
The test suite generated by the Reactis Tester instance given as a
parameter. Must be called after Tester has finished (i.e., when
rsTesterIsRunning returns 0). Returns NULL if Tester is still running or an
error occurred that prevented the creation of a test suite.
rsTesterGetNumStepsTaken
Retrieve number of steps taken so far during tester run.
Syntax
int rsTesterGetNumStepsTaken (RsTester *tester);
Parameters
- tester
- Pointer to RsTester instance that was previously started with
rsTesterStart.
Return Value
Returns the number of steps taken so far during this tester run.