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
Branches containing commit
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
tcv
([],[],[],
'compile'
);
tcv
([],[],[],
'term'
);
catch
ME
tcv
([],[],[],
'term'
);
rethrow
(
ME
)
end
end
function
sim
(
obj
)
sim
(
'tcv'
)
end
end
end
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
end
properties
(
MethodSetupParameter
)
expcode_number
=
{
'1'
,
'1005'
,
'
1006'
,
'
1010'
};
% list of expcodes to test
expcode_number
=
{
'1'
,
'1005'
,
'1010'
};
% list of expcodes to test
end
methods
(
TestClassSetup
)
...
...
@@ -35,7 +35,7 @@ classdef test_expcodes < matlab.unittest.TestCase
fprintf
(
'\n=== Testing callinits for expcode %d: %s === \n'
,
...
testCase
.
expcode_obj
.
maincode
,
testCase
.
expcode_obj
.
name
);
testCase
.
expcode_obj
.
callinits
;
fprintf
(
'\n=== Testing setup for expcode %d: %s === \n'
,
...
testCase
.
expcode_obj
.
maincode
,
testCase
.
expcode_obj
.
name
);
...
...
@@ -45,34 +45,26 @@ classdef test_expcodes < matlab.unittest.TestCase
end
methods
(
Test
)
function
test_expcode
(
testCase
)
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
end
function
test_gencode
(
testCase
)
switch
testCase
.
expcode_obj
.
maincode
case
1010
SCDconf_setCODEconf
(
'configurationSettingsCODEicc'
)
rtwbuild
(
'SCD_rtccode_02_02'
);
rtwbuild
(
'SCD_rtccode_02_03'
);
otherwise
% do nothing
end
function
test_rtwbuild
(
testCase
)
assert
(
~
isempty
(
getenv
(
'RTCCODE_LIBPATH'
)),
'RTCCODE_LIBPATH environment variable needs to be defined to compile'
);
SCDconf_setCODEconf
(
'configurationSettingsCODEicc'
)
switch
testCase
.
expcode_obj
.
maincode
case
1005
rtwbuild
(
'SCD_rtccode_02_02'
);
case
1010
rtwbuild
(
'SCD_rtccode_02_02'
);
rtwbuild
(
'SCD_rtccode_02_03'
);
otherwise
% do nothing
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
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