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
b7e9b6e6
Commit
b7e9b6e6
authored
5 years ago
by
Federico Felici
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup tests for expcodes
parent
3481f1fb
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_expcodes.m
+26
-14
26 additions, 14 deletions
tests/test_expcodes.m
with
26 additions
and
14 deletions
tests/test_expcodes.m
+
26
−
14
View file @
b7e9b6e6
...
...
@@ -6,7 +6,7 @@ classdef test_expcodes < matlab.unittest.TestCase
shot
=
65668
;
% a shot with data, for actualize/sim purposes
end
properties
(
Method
SetupParameter
)
properties
(
Class
SetupParameter
)
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
)
...
...
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