Skip to content
Snippets Groups Projects
Commit b7e9b6e6 authored by Federico Felici's avatar Federico Felici
Browse files

Cleanup tests for expcodes

parent 3481f1fb
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ classdef test_expcodes < matlab.unittest.TestCase
shot = 65668; % a shot with data, for actualize/sim purposes
end
properties(MethodSetupParameter)
properties(ClassSetupParameter)
expcode_number = {'1','1005','1010'}; % list of expcodes to test
end
......@@ -25,15 +25,17 @@ classdef test_expcodes < matlab.unittest.TestCase
SCDconf_setSIMconf; % set ConfigurationSettings for Simulation
end
end
methods(TestMethodSetup)
function setup_expcode(testCase,expcode_number)
% get this expcode object from expcode object container
fprintf('\n=== Testing expcode %s ===\n',expcode_number);
testCase.expcode_obj = getbymaincode(testCase.SCDexps,str2double(expcode_number));
end
end
methods(Test)
function test_expcode_printinfo(testCase)
testCase.expcode_obj.printinfo
end
......@@ -59,24 +61,34 @@ classdef test_expcodes < matlab.unittest.TestCase
testCase.expcode_obj.maincode,...
testCase.expcode_obj.name);
testCase.expcode_obj.callinits(testCase.shot);
fprintf('\n=== Testing setup for expcode %d: %s === \n',...
testCase.expcode_obj.maincode,...
testCase.expcode_obj.name);
testCase.expcode_obj.setup; % run setup this exp code
end
end
methods(Test)
function test_expcode_compile(testCase)
fprintf('\n === Testing Simulink compilation for expcode %d: %s === \n',...
testCase.expcode_obj.maincode,testCase.expcode_obj.name);
% attempt compiling tcv.slx for this expcode
testCase.expcode_obj.compile; % compile tcv.slx with this expcode
function test_callinits(testCase)
testCase.expcode_obj.callinits;
end
function test_expcode_compile_nodes(testCase)
% compile each node separately first
for inode = 1:numel(testCase.expcode_obj.nodes)
node = testCase.expcode_obj.nodes(inode);
if node.active
fprintf('\n === Testing Simulink compilation for node %02d of expcode %d: %s === \n',...
inode,testCase.expcode_obj.maincode,testCase.expcode_obj.name);
testCase.expcode_obj.compile(inode); % compile single node
else
fprintf('skipping compilation for node %d since not active\n',inode)
end
end
end
function test_expcode_compile_all(testCase)
testCase.expcode_obj.compile; % compile whole tcv.slx with this expcode
end
function test_build(testCase)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment