Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
0317c9ad
Commit
0317c9ad
authored
5 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Fixes to make the tests run
parent
4af5e351
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
code/classes/SCDclass_expcode.m
+1
-2
1 addition, 2 deletions
code/classes/SCDclass_expcode.m
tests/test_expcodes.m
+15
-23
15 additions, 23 deletions
tests/test_expcodes.m
with
16 additions
and
25 deletions
code/classes/SCDclass_expcode.m
+
1
−
2
View file @
0317c9ad
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
tests/test_expcodes.m
+
15
−
23
View file @
0317c9ad
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment