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

Add methods for compiling and simulating algo and expcode

parent 546fd9a6
No related branches found
No related tags found
No related merge requests found
......@@ -296,6 +296,20 @@ classdef SCDclass_algo
end
end
function compile(obj)
try
eval(sprintf('%s([],[],[],''compile'')',obj.modelname));
catch
eval(sprintf('%s([],[],[],''term'')',obj.modelname));
end
eval(sprintf('%s([],[],[],''term'')',obj.modelname));
end
function sim(obj)
sim(obj.modelname);
end
end
end
......@@ -531,7 +531,16 @@ classdef SCDclass_expcode
fprintf(" }\n");
fprintf("}\n");
end
function tcvcompile(obj)
try
tcv([],[],[],'compile');
tcv([],[],[],'term');
catch ME
tcv([],[],[],'term');
rethrow(ME)
end
end
end
methods (Access = private)
......
......@@ -31,16 +31,17 @@ classdef test_expcodes < matlab.unittest.TestCase
end
methods(Test)
function test_callinits(testCase)
testCase.expcode_obj.callinits;
end
function test_setup(testCase)
testCase.expcode_obj.setup; % run setup this exp code
end
function test_expcode(testCase)
% attempt compiling tcv.slx for this expcode
try
tcv([],[],[],'compile');
tcv([],[],[],'term');
catch ME
tcv([],[],[],'term');
rethrow(ME)
end
testCase.assertTrue(true); % dummy
testCase.expcode_obj.tcvcompile; % compile tcv.slx with this expcode
end
end
......
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