4. Reactis Tester#
4.1. rsTester#
Generate a test suite for a model.
4.1.1. Syntax#
suiteId = rsTester(modelFilename)
suiteId = rsTester(modelFilename,rsiFilename)
suiteId = rsTester(modelFilename,rsiFilename,suiteFilename)
suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters)
suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters,
reportFilename)
suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters,
reportFilename,reportConfig)
4.1.2. Description#
- suiteId = rsTester(modelFilename)
creates a test suite for modelFilename using default settings. No .rsi file is used (even if one exists with the default name). This means model-specific settings will have default values and there are no input constraints or configuration variables.
- suiteId = rsTester(modelFilename,rsiFilename)
creates a test suite for modelFilename using settings from rsiFilename.
- suiteId = rsTester(modelFilename,rsiFilename,suiteFilename)
creates a test suite for modelFilename using settings from rsiFilename. The generated suite is saved in a file named suiteFilename.
- suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters)
Same as above, but you may pass additional parameters in the string argument extraParameters. The format of this string is described in Tester Additional Parameters.
- suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters,reportFilename)
Same as above, but also creates an HTML report about the generated test suite and saves the report in reportFilename.
- suiteId = rsTester(modelFilename,rsiFilename,suiteFilename,extraParameters,reportFilename,reportConfig)
Same as above, but you may also specify which information should be included in the HTML report using reportConfig, a data structure created by calling rsReportConfig.
Any parameter except modelFilename may be omitted by passing in an empty matrix instead.
The return value suiteId is a scalar integer valued double that identifies the generated test suite for use with other API functions. The test suite should be closed when no longer needed by calling rsSuiteClose. If no test suite file name was given in the rsTester call, the test suite should be saved by calling rsSuiteSave before closing it, otherwise the test data contained in the suite will be deleted. After the rsTester call finishes, coverage information may be obtained by calling rsGetCoverageMetrics.
4.1.3. Examples#
suiteId = rsTester('cruise.slx','cruise.rsi','cruiseTestSuite.rst');
Generate a test suite for model cruise.slx using settings in cruise.rsi and save the resulting test suite to cruiseTestSuite.rst.
4.1.4. See Also#
rsTesterStart, rsSuiteSave, rsSuiteClose, rsReportConfig, rsGetCoverageMetrics
4.2. rsTesterStart#
Initiate the asynchronous generation of a test suite.
4.2.1. Syntax#
testerId = rsTesterStart(modelFilename)
testerId = rsTesterStart(modelFilename,rsiFilename)
testerId = rsTesterStart(modelFilename,rsiFilename,suiteFilename)
testerId = rsTesterStart(modelFilename,rsiFilename,suiteFilename,extraParameters)
testerId = rsTesterStart(modelFilename,rsiFilename,suiteFilename,extraParameters,
reportFilename)
testerId = rsTesterStart(modelFilename,rsiFilename,suiteFilename,extraParameters,
reportFilename,reportConfig)
4.2.2. Description#
The invocation of rsTesterStart works exactly as that of rsTester, but instead of only returning after test suite creation completes, rsTesterStart returns immediately and test suite creation continues asynchronously. The return value testerId is a scalar integer valued double that can be used to communicate with the test generation process using other API functions:
Function |
Description |
---|---|
Query if test generation is still running. |
|
Query test generation progress. |
|
Retrieve the newly generated test suite. |
|
Stop the running test generation. |
|
Close a Tester session and release memory. |
4.2.3. Examples#
>> tid = rsTesterStart('cruise.slx','cruise.rsi');
>> rsTesterIsRunning(tid)
ans =
1
>> rsTesterGetProgress(tid)
ans =
20.4000
>> rsTesterGetStatus(tid)
ans =
Targeted phase
4.2.4. See Also#
rsTesterIsRunning, rsTesterGetProgress, rsTesterGetStatus, rsTesterGetSuite, rsTesterStop, rsTesterClose, rsTester, rsSuiteSave, rsSuiteClose, rsReportConfig
4.3. rsTesterStop#
Stop running asynchronous test suite generation.
4.3.1. Syntax#
rsTesterStop(testerId)
4.3.2. Description#
- rsTesterStop(testerId)
stops test suite creation in the asynchronous Tester session identified by testerId (initiated by rsTesterStart). The part of the test suite that was created before the call to rsTesterStop can be accessed by calling rsTesterGetSuite.
4.3.3. Examples#
>> tid = rsTesterStart('cruise.slx','cruise.rsi');
>> rsTesterStop(tid);
4.3.4. See Also#
rsTesterStart, rsTesterIsRunning, rsTesterGetProgress, rsTesterGetSuite, rsTesterClose
4.4. rsTesterClose#
Close a Reactis Tester session.
4.4.1. Syntax#
rsTesterClose(testerId)
4.4.2. Description#
- rsTesterClose(testerId)
closes the asynchronous Tester session identified by testerId.
4.4.3. See Also#
4.5. rsTesterIsRunning#
True if test suite creation is still ongoing.
4.5.1. Syntax#
running = rsTesterIsRunning(testerId)
4.5.2. Description#
- running = rsTesterIsRunning(testerId)
returns 1 if the asynchronous Reactis Tester session identified by testerId (initiated by rsTesterStart) is still running and 0 if it has finished.
4.5.3. See Also#
rsTesterStart, rsTesterGetStatus, rsTesterGetProgress, rsTesterStop, rsTesterGetSuite, rsTesterClose
4.6. rsTesterGetNumStepsTaken#
Get the number of steps taken during test suite generation.
4.6.1. Syntax#
rsTesterGetNumStepsTaken(testerId)
4.6.2. Description#
- P = rsTesterGetNumStepsTaken(testerId)
returns a number identifying how many steps Reactis Tester session testerId (initiated by rsTesterStart) has taken so far during its run.
4.6.3. See Also#
rsTesterStart, rsTesterIsRunning, rsTesterGetStatus, rsTesterStop, rsTesterGetSuite, rsTesterClose, rsTesterGetProgress
4.7. rsTesterGetProgress#
Get test suite generation progress.
4.7.1. Syntax#
percentComplete = rsTesterGetProgress(testerId)
4.7.2. Description#
- percentComplete = rsTesterGetProgress(testerId)
returns a scalar double in the range 0..100 to identify the percentage of test steps completed by the asynchronous Reactis Tester session identified by testerId (initiated by rsTesterStart).
4.7.3. Examples#
>> tid = rsTesterStart('cruise.slx','cruise.rsi')
tid =
1
>> rsTesterGetProgress(tid)
ans =
20.4000
4.7.4. See Also#
rsTesterStart, rsTesterIsRunning, rsTesterGetStatus, rsTesterStop, rsTesterGetSuite, rsTesterClose
4.8. rsTesterGetStatus#
Get test suite generation status.
4.8.1. Syntax#
status = rsTesterGetStatus(testerId)
4.8.2. Description#
- status = rsTesterGetStatus(testerId)
returns a string identifying the current status of the asynchronous Tester Session identified by testerId (initiated by rsTesterStart).
4.8.3. Examples#
>> tid = rsTesterStart('cruise.slx','cruise.rsi')
tid =
1
>> status = rsTesterGetStatus(tid)
status =
Targeted phase
4.8.4. See Also#
rsTesterStart, rsTesterIsRunning, rsTesterGetProgress, rsTesterStop, rsTesterGetSuite, rsTesterClose
4.9. rsTesterGetSuite#
Get test suite after generation is finished.
4.9.1. Syntax#
suiteId = rsTesterGetSuite(testerId)
4.9.2. Description#
- suiteId = rsTesterGetSuite(testerId)
returns the test suite generated by a call to rsTesterStart. If test suite generation has not yet finished, suiteId will be an empty matrix. Otherwise, suiteId is a scalar integer valued double that identifies the test suite file for use with other API functions. When no longer needed, test suite suiteId should be closed by calling rsSuiteClose. If no test suite file name was given in the rsTesterStart call, the test suite should be saved by calling rsSuiteSave before closing it, otherwise the test data contained in the suite will be deleted.
4.9.3. See Also#
rsTesterStart, rsTesterIsRunning, rsTesterGetStatus, rsTesterStop, rsTesterGetSuite, rsTesterClose, rsSuiteClose, rsSuiteSave