23. Running Reactis Tests in Simulink#
23.1. rsRunTests#
Run a Reactis test suite in Simulink.
23.1.1. Syntax#
rsRunTests
rsRunTests(mdlFile, mFile)
rsRunTests(mdlFile, mFile, eps)
rsRunTests(mdlFile, mFile, eps, logFile)
rsRunTests(mdlFile, mFile, eps, logFile, wrapPortsFlag)
23.1.2. Description#
The rsRunTests function can be used to execute Reactis-generated tests in Simulink. Prior to using tests in rsRunTests, the suite must be exported from Reactis into .m or .mat format.
- rsRunTests
starts a GUI from which tests can be run.
- rsRunTests(mdlFile, mFile)
executes the test suite mFile (an .m or .mat file exported from Reactis) on model mdlFile. mdlFile and mFile may include path specifiers. The error tolerance will be taken from mFile (see below).
- rsRunTests(mdlFile, mFile, eps)
works the same as above, except uses an error tolerance value of eps.
- rsRunTests(mdlFile, mFile, eps, logFile)
works the same as above and outputs details of the run in a log file named logFile. If the file extension of logFile is .csv, then the output will be written in machine-parsable CSV format. If extension is not .csv, then the output will be human-readable.
- rsRunTests(mdlFile, mFile, eps, logFile, ‘-WRAPPORTS’)
will modify fixpoint inports and outports to allow feeding in and logging ‘double’ values.
If no eps argument is given, or if eps is negative, then the tolerance stored in mFile is used. If mFile does not contain an eps value, or the eps value stored in mFile is negative, then a default value of 1e-10 is used. A difference between and output value stored in a test suite and the corresponding output value computed by the model is flagged if it exceeds the the error tolerance specified by eps. More precisely, for an outport p, let
- v1
be the value computed by Reactis for outport p v2
be the value computed by Simulink for outport p
then an error is reported for outport p if \(| v1 - v2 | > | eps \times v1 |\) or \(| v1 - v2 | > | eps \times v2 |\)
23.2. rsSignalBuilderImport#
Import a Reactis test suite into a Signal Builder block.
23.2.1. Syntax#
rsSignalBuilderImport(blockPath, exportedTestSuite)
rsSignalBuilderImport(blockPath, testSuite, testModel)
rsSignalBuilderImport(blockPath, testSuite, testModel, rsiFile)
23.2.2. Description#
- rsSignalBuilderImport(blockPath, exportedTestSuite)
- blockPath
Is the path to the Signal Builder block in the model. If a Signal Builder block SB1 resides at the top level of a model foo then the path would simply be foo/SB1. If the specified block does not exist, a new block will be added to the model.
- exportedTestSuite
Is the name of the .m or .mat file containing the test suite to be imported. This file must have been generated by exporting a test suite from Reactis.
- rsSignalBuilderImport(blockPath, testSuite, testModel)
- blockPath
Is the path to the Signal Builder block as described above.
- testSuite
Is the name of the .rst file containing a Reactis test suite.
- testModel
Is the name of the model from which testSuite was generated. The inputs, outputs, and configuration variables of this model must match testSuite. If testModel is foo.slx, then foo.rsi will be used to export the .rst to .mat and then import the .mat into the Signal Builder block.
- rsSignalBuilderImport(blockPath, testSuite, testModel, rsiFile)
Same as above except you may specify an alternative .rsi file.
23.3. rsInterpolateOff#
Turn interpolation off for all top-level inputs of a model.
23.3.1. Syntax#
rsInterpolateOff
rsInterpolateOff(modelName)
23.3.2. Description#
- rsInterpolateOff
turns of interpolation for all top-level input ports of the model currently open in Simulink. This is necessary to run Reactis-exported test suites in Simulink.
- rsInterpolateOff(modelName)
turns of interpolation for all top-level input ports of modelName.