8. Reactis Harness Library - Harnesses#

8.1. rcRshGetHarnesses#

Get a list of harnesses stored in an .rsh file.

8.1.1. Syntax#

harnessIds = rcRshGetHarnesses(rshFile)

8.1.2. Description#

harnessIds = rcRshGetHarnesses(rshFile)

returns a cell array containing a list of id numbers for each harness stored in the .rsh file. Each harness id number is an integer-valued double.

8.1.3. See Also#

rcRshOpen

8.2. rcRshHarnessCopy#

Copy a test harness.

8.2.1. Syntax#

newHarnessId = rcRshHarnessCopy(harnessId,newName)
newHarnessId = rcRshHarnessCopy(harnessId,newName,entryName)
newHarnessId = rcRshHarnessCopy(harnessId,newName,entryFullName)

8.2.2. Description#

newHarnessId = rcRshHarnessCopy(harnessId,newName)

creates a new harness with the name given by newName. All other properties are copied from the harness identified by harnessId. The id of the new harness is returned.

newHarnessId = rcRshHarnessCopy(harnessId,newName,newEntry)

creates a new harness with the name given by newName and entry function given by newEntry. All other properties are copied from the harness identified by harnessId. newEntry should be one of the strings returned by rcRshGetEntryFunCandidates. The id of the new harness is returned.

8.2.3. See Also#

rcRshGetEntryFunCandidates

8.3. rcRshHarnessCreate#

Create a test harness.

8.3.1. Syntax#

harnessId = rcRshHarnessCreate(rshId,harnessName,entry)
harnessId = rcRshHarnessCreate(rshId,harnessName,entry,init)

8.3.2. Description#

harnessId = rcRshHarnessCreate(rshId,harnessName,entry)

creates a new test harness with name harnessName and entry function entry. entry can be either (a) the name of the function in the C code, or (2) one of the strings returned by rcRshGetEntryFunCandidates. The id of the new harness is returned.

harnessId = rcRshHarnessCreate(rshId,harnessName,entry,init)

creates a new test harness with name harnessName, entry function entry, and initialization function init. entry should be one of the strings returned by rcRshGetEntryFunCandidates. init should be one of the strings returned by rcRshGetInitFunCandidates. The id of the new harness is returned.

8.3.3. See Also#

rcRshOpen, rcRshGetEntryFunCandidates, rcRshGetInitFunCandidates

8.4. rcRshHarnessImport#

Import a test harness from an .rsi file.

8.4.1. Syntax#

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap)
harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap,initName)

8.4.2. Description#

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName)

creates a test harness with name harnessName and entry function entryName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap)

creates a test harness with name harnessName and entry function entryName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename using the name mapping supplied by nameMap. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

harnessId = rcRshHarnessImport(rshId,rsiFilename,harnessName,entryName,nameMap,initName)

creates a test harness with name harnessName, entry function entryName, and initialization function initName. The input, output, and configuration variables of the new harness are imported from the .rsi file named by rsiFilename using the name mapping supplied by nameMap. The new harness is added to the library identified by rshId. The id number of the new harness is returned.

nameMap is a structure which can contain 1 or more of the following fields:

input.code.prefix

Prefix of input names in the C code

input.code.suffix

Suffix of input names in the C code

input.harness.prefix

Prefix of input names in the test harness

input.harness.suffix

Suffix of input names in the test harness

output.code.prefix

Prefix of output names in the C code

output.code.suffix

Suffix of output names in the C code

output.harness.prefix

Prefix of output names in the test harness

output.harness.suffix

Suffix to output names in the test harness

config.code.prefix

Prefix of configuration variable names in the C code

config.code.suffix

Suffix of configuration variable names in the C code

config.harness.prefix

Prefix of configuration variable names in the test harness

config.harness.suffix

Suffix of configuration variable names in the test harness

8.4.3. Examples#

nameMap.input.code.prefix = ‘cruise_U.’; nameMap.output.code.prefix = ‘cruise_Y.’; nameMap.config.code.prefix = ‘cruise_P.’;

8.4.4. See Also#

rcRshOpen

8.5. rcRshHarnessGetEntryFunFullName#

Get the full name of the entry function used by a test harness.

8.5.1. Syntax#

fullName = rcRshHarnessGetEntryFunFullName(harnessId) 

8.5.2. Description#

fullName = rcRshHarnessGetEntryFunFullName(harnessId)

returns the full name of the entry function used by the test harness identified by harnessId.

8.5.3. See Also#

rcRshOpen, rcRshGetHarnesses

8.6. rcRshHarnessGetEntryFunName#

Get the name of the entry function used by a test harness.

8.6.1. Syntax#

name = rcRshHarnessGetEntryFunName(harnessId)

8.6.2. Description#

name = rcRshHarnessGetEntryFunName(harnessId)

returns the name of the entry function used by the test harness whose id matches harnessId.

8.6.3. See Also#

rcRshOpen, rcRshHarnessCreate, rcRshHarnessCopy

8.7. rcRshHarnessGetName#

Get the name of a test harness.

8.7.1. Syntax#

name = rcRshHarnessGetName(harnessId)

8.7.2. Description#

name = rcRshHarnessGetName(harnessId)

returns the name of the test harness identified by harnessId.

8.7.3. See Also#

rcRshOpen, rcRshGetHarnesses

8.8. rcRshHarnessGetSampleRate#

Get the sample rate of a test harness.

8.8.1. Syntax#

rcRshHarnessGetSampleRate(harnessId)

8.8.2. Description#

rcRshHarnessGetSampleRate(harnessId)

returns the sample rate of the test harness identified by harnessId.

8.8.3. See Also#

rcRshOpen, rcRshGetHarnesses, rcRshHarnessSetSampleRate

8.9. rcRshHarnessGetVars#

Get the variables used by a test harness.

8.9.1. Syntax#

varIds = rcRshHarnessGetVars(harnessId,varKind)

8.9.2. Description#

varIds = rcRshHarnessGetVars(harnessId,varKind)

returns an array containing the id number of every variable whose kind matches varKind. kind should be one of the following: RcInputVar, RcOutputVar, RcConfigVar. Each variable id number is an integer-valued double.

8.9.3. See Also#

rcRshOpen, rcRshHarnessAddVar, rcRshVarDelete

8.10. rcRshHarnessSetSampleRate#

Set the sample rate of a test harness.

8.10.1. Syntax#

rcRshHarnessSetSampleRate(harnessId,rate)

8.10.2. Description#

rcRshHarnessSetSampleRate(harnessId,rate)

sets the sample rate of the test harness identified by harnessId to equal rate. The value of rate should be a positive real number.

8.10.3. See Also#

rcRshOpen, rcRshHarnessGetSampleRate

8.11. rcRshHarnessSync#

Synchronize types between a test harness and the code under test.

8.11.1. Syntax#

rcRshHarnessSync(harnessId) 

8.11.2. Description#

rcRshHarnessSync(harnessId)

Changes the variables used in the test harness identifed by harnessId to match the code under test.

  • If the entry function has a (non-pointer) parameter which is not an input variable in the harness, it is added to the harness inputs.

  • If an input, output, or configuration variable exists in the harness but not in the code, it is removed from the harness.

  • If an input, output, or configuration variable exists in both the harness and the code, and the types do not match, the type of the harness variable is changed to match the type in the code. If any type restrictions were set for that variable in the harness, the restrictions are removed.

Any changes made by rcRshHarnessSync will be saved to disk during the next call to rcRshSave.

8.11.3. See Also#

rcRshOpen, rcRshSave