getPreSaveFcn
Class: slreq.ReqSet
Package: slreq
Syntax
callback = getPreSaveFcn(rs)
Description
returns the contents of the callback
= getPreSaveFcn(rs
)PreSaveFcn
callback for the requirement set
rs
.
Input Arguments
rs
— Requirement set
slreq.ReqSet
object
Requirement set, specified as an slreq.ReqSet
object.
Output Arguments
callback
— Contents of PreSaveFcn
callback
character vector
Contents of the PreSaveFcn
callback for the requirement set,
returned as a character vector.
Examples
Get and Set PreSaveFcn
Callback
This example shows how to get and set the PreSaveFcn
callback for a requirement set.
Add the current folder to the path.
addpath(pwd)
Open the ShortestPath
project that contains an algorithm to calculate the shortest path between two nodes on a graph. For more information, see Verify a MATLAB Algorithm by Using Requirements-Based Tests.
openProject("ShortestPath");
Open the shortest_path_tests_reqs
requirement set. The requirement set contains test requirements that describe the functional behavior that must be tested by a test case in order to verify the shortest_path
algorithm in the project.
testReqs = slreq.open("shortest_path_tests_reqs");
Register the preSaveTestReqs
script as the PreSaveFcn
callback.
setPreSaveFcn(testReqs,"preSaveTestReqs");
Confirm that the preSaveTestReqs
script is the PreSaveFcn
callback for the shortest_path_tests_reqs
requirement set.
callbackScript = getPreSaveFcn(testReqs)
callbackScript = 'preSaveTestReqs'
Save the shortest_path_tests_reqs
requirement set to execute the callback.
save(testReqs);
The preSaveTestReqs
script saves the current Requirements Editor view settings to a MAT-file called myViewSettings.mat
.
type preSaveTestReqs.m
slreq.exportViewSettings("myViewSettings.mat");
Version History
Introduced in R2022a
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)