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

Fixes to make the tests run

parent 4af5e351
No related branches found
No related tags found
No related merge requests found
...@@ -554,14 +554,13 @@ classdef SCDclass_expcode ...@@ -554,14 +554,13 @@ classdef SCDclass_expcode
tcv([],[],[],'compile'); tcv([],[],[],'compile');
tcv([],[],[],'term'); tcv([],[],[],'term');
catch ME catch ME
tcv([],[],[],'term');
rethrow(ME) rethrow(ME)
end end
end end
function sim(obj) function sim(obj)
sim('tcv') sim('tcv')
end end
end end
methods (Access = private) methods (Access = private)
......
...@@ -6,7 +6,7 @@ classdef test_expcodes < matlab.unittest.TestCase ...@@ -6,7 +6,7 @@ classdef test_expcodes < matlab.unittest.TestCase
end end
properties(MethodSetupParameter) properties(MethodSetupParameter)
expcode_number = {'1','1005','1006','1010'}; % list of expcodes to test expcode_number = {'1','1005','1010'}; % list of expcodes to test
end end
methods(TestClassSetup) methods(TestClassSetup)
...@@ -35,7 +35,7 @@ classdef test_expcodes < matlab.unittest.TestCase ...@@ -35,7 +35,7 @@ classdef test_expcodes < matlab.unittest.TestCase
fprintf('\n=== Testing callinits for expcode %d: %s === \n',... fprintf('\n=== Testing callinits for expcode %d: %s === \n',...
testCase.expcode_obj.maincode,testCase.expcode_obj.name); testCase.expcode_obj.maincode,testCase.expcode_obj.name);
testCase.expcode_obj.callinits; testCase.expcode_obj.callinits;
fprintf('\n=== Testing setup for expcode %d: %s === \n',... fprintf('\n=== Testing setup for expcode %d: %s === \n',...
testCase.expcode_obj.maincode,testCase.expcode_obj.name); testCase.expcode_obj.maincode,testCase.expcode_obj.name);
...@@ -45,34 +45,26 @@ classdef test_expcodes < matlab.unittest.TestCase ...@@ -45,34 +45,26 @@ classdef test_expcodes < matlab.unittest.TestCase
end end
methods(Test) methods(Test)
function test_expcode(testCase) function test_expcode_compile(testCase)
fprintf('\n === Testing Simulink compilation for expcode %d: %s === \n',... fprintf('\n === Testing Simulink compilation for expcode %d: %s === \n',...
testCase.expcode_obj.maincode,testCase.expcode_obj.name); testCase.expcode_obj.maincode,testCase.expcode_obj.name);
% attempt compiling tcv.slx for this expcode % attempt compiling tcv.slx for this expcode
testCase.expcode_obj.compile; % compile tcv.slx with this expcode testCase.expcode_obj.compile; % compile tcv.slx with this expcode
end end
function test_gencode(testCase) function test_rtwbuild(testCase)
switch testCase.expcode_obj.maincode assert(~isempty(getenv('RTCCODE_LIBPATH')),'RTCCODE_LIBPATH environment variable needs to be defined to compile');
case 1010 SCDconf_setCODEconf('configurationSettingsCODEicc')
switch testCase.expcode_obj.maincode
SCDconf_setCODEconf('configurationSettingsCODEicc') case 1005
rtwbuild('SCD_rtccode_02_02'); rtwbuild('SCD_rtccode_02_02');
rtwbuild('SCD_rtccode_02_03'); case 1010
otherwise rtwbuild('SCD_rtccode_02_02');
% do nothing rtwbuild('SCD_rtccode_02_03');
end otherwise
% do nothing
end
end end
function test_compilation(testCase)
expcode_ignore_compile = 1006;
testCase.assumeTrue(~any(testCase.expcode_obj.maincode == expcode_ignore_compile))
node_to_compile = 'SCD_rtccode_02_02';
node_to_compile = 'SCD_rtccode_02_03';
load_system(node_to_compile);
SCDconf_setCODEconf;
rtwbuild(node_to_compile);
end
end end
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