Can I find/see the requirement I linked inside a test sequence that is inside a test harness in Simulink with Matlab script?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I tried using the line of code below...
sltest.testsequence.readStep([model,'/Test Sequence'],steps{g})
...hoping to catch the linked requirement inside the Test Sequence step. However I only get the struct with the fields:
Name:
Action:
IsWhenStep:
IsWhenSubStep:
Description:
TransitionCount:
Is there a way I could try to see the requirement just through Matlab Script?
1 comentario
Nikhil Boddula
el 27 de Mayo de 2021
Even I'm trying for the same. Please post line of code how to catch the linked requirement inside the Test Sequence step if you have got resolved.
Respuestas (1)
Raymond G. Estrada Jr
el 10 de Feb. de 2023
Here's how you can do this via existing APIs (using our do178CaseStudyStart demo)
%Block path to test sequence diagram
myTS = 'AHRS_Voter_Harness_HLR_12/Test Sequence';
%extract steps
myTS_steps = sltest.testsequence.findStep("AHRS_Voter_Harness_HLR_12/Test Sequence");
%Get the Stateflow object for the Test Sequence block
tsObj = root.find("-isa", "Stateflow.ReactiveTestingTableChart", "Path", "AHRS_Voter_Harness_HLR_12/Test Sequence");
%Loop through all steps to extract requirement information
for ii=1:length(myTS_steps)
state_step = tsObj.find('-isa', 'Stateflow.State', 'Name', myTS_steps{ii}); %Stateflow object for the step "chart"
outlinks = slreq.outLinks(state_step); %Get outlinks for the step "chart"
dest = arrayfun(@(x) x.destination, outlinks{ii,1}); %Get the destination information
%Example of packaging the data
reqInfo.(myTS_steps{ii}).path = state_step.Path;
reqInfo.(myTS_steps{ii}).stepContent = state_step.LabelString;
reqInfo.(myTS_steps{ii}).reqLinks = dest{ii,1};
end
0 comentarios
Ver también
Categorías
Más información sobre Inputs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!