Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MSA Toolkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Aerodynamics and Flight Dynamics
Mission Analysis
MSA Toolkit
Commits
36eb5845
Commit
36eb5845
authored
3 months ago
by
Lorenzo Amici
Browse files
Options
Downloads
Patches
Plain Diff
[unit-test-updates] split settings in saveTests and removed addpath
parent
b01da53e
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#11845
failed
3 months ago
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
unitTests/mainUnitTest.m
+1
-1
1 addition, 1 deletion
unitTests/mainUnitTest.m
unitTests/saveTests.m
+7
-7
7 additions, 7 deletions
unitTests/saveTests.m
unitTests/tests/TestSimulator.m
+7
-8
7 additions, 8 deletions
unitTests/tests/TestSimulator.m
with
15 additions
and
16 deletions
unitTests/mainUnitTest.m
+
1
−
1
View file @
36eb5845
This diff is collapsed.
Click to expand it.
unitTests/saveTests.m
+
7
−
7
View file @
36eb5845
...
@@ -19,22 +19,22 @@ mission = Mission(true);
...
@@ -19,22 +19,22 @@ mission = Mission(true);
if
isempty
(
rocket
),
rocket
=
Rocket
(
mission
);
end
if
isempty
(
rocket
),
rocket
=
Rocket
(
mission
);
end
if
isempty
(
environment
),
environment
=
Environment
(
mission
,
rocket
.
motor
);
end
if
isempty
(
environment
),
environment
=
Environment
(
mission
,
rocket
.
motor
);
end
if
isempty
(
wind
),
wind
=
Wind
(
mission
);
end
if
isempty
(
wind
),
wind
=
Wind
(
mission
);
end
if
isempty
(
settings
)
if
isempty
(
settings
),
settings
=
Settings
(
'unitTest'
);
end
simPath
=
fullfile
(
fileparts
(
mfilename
(
'fullpath'
)),
'..'
,
'simulator'
,
'simulatorConfig.m'
);
%odePath = fullfile(fileparts(mfilename('fullpath')), '..', '..', 'common', 'settings ', 'odeConfig.m');
settings
=
Settings
(
simPath
,
'ode'
,
'unitTest'
);
end
Settings
.
read
(
settings
,
options
,
'unitTest'
);
Settings
.
read
(
settings
,
options
,
'unitTest'
);
%% CREATING SIMULATOR TESTS
%% CREATING SIMULATOR TESTS
if
~
isempty
(
settings
.
unitTest
.
saveTestSimulator
)
if
~
isempty
(
settings
.
unitTest
.
saveTestSimulator
)
simPath
=
fullfile
(
fileparts
(
mfilename
(
'fullpath'
)),
'..'
,
'simulator'
,
'simulatorConfig.m'
);
simSettings
=
Settings
(
'ode'
,
simPath
);
for
k
=
1
:
length
(
settings
.
unitTest
.
saveTestSimulator
)
for
k
=
1
:
length
(
settings
.
unitTest
.
saveTestSimulator
)
TestSimulator
.
saveTest
(
settings
.
unitTest
.
saveTestSimulator
{
k
},
mission
,
rocket
,
wind
,
environment
,
settings
);
TestSimulator
.
saveTest
(
settings
.
unitTest
.
saveTestSimulator
{
k
},
rocket
,
wind
,
environment
,
s
imS
ettings
);
end
end
end
end
%% TEST APOGEE ANALYSIS
%% TEST APOGEE ANALYSIS
if
settings
.
unitTest
.
saveTestApogeeAnalysis
if
settings
.
unitTest
.
saveTestApogeeAnalysis
apoPath
=
fullfile
(
fileparts
(
mfilename
(
'fullpath'
)),
'..'
,
'apogeeAnalysis'
,
'apogeeAnalysisConfig.m'
);
apoSettings
=
Settings
(
'ode'
,
apoPath
);
TestApogeeAnalysis
.
saveTest
(
mission
);
TestApogeeAnalysis
.
saveTest
(
mission
);
end
end
...
...
This diff is collapsed.
Click to expand it.
unitTests/tests/TestSimulator.m
+
7
−
8
View file @
36eb5845
...
@@ -3,17 +3,18 @@ classdef TestSimulator < matlab.unittest.TestCase
...
@@ -3,17 +3,18 @@ classdef TestSimulator < matlab.unittest.TestCase
properties
properties
settings
settings
refSimulator
refSimulator
rocket
wind
environment
end
end
properties
(
MethodSetupParameter
)
properties
(
MethodSetupParameter
)
verifiable
=
{
'multipleAB'
,
'ballistic'
,
'engineCut'
,
'solid'
,
'HRE'
};
verifiable
=
{
'multipleAB'
,
'ballistic'
,
'engineCut'
,
'solid'
,
'HRE'
};
end
end
methods
(
TestMethodSetup
)
methods
(
TestMethodSetup
)
function
setup
(
testCase
,
verifiable
)
function
setup
(
testCase
,
verifiable
)
currentPath
=
fileparts
(
mfilename
(
'fullpath'
));
currentPath
=
fileparts
(
mfilename
(
'fullpath'
));
addpath
(
genpath
(
currentPath
));
fileName
=
sprintf
(
"referenceState_%s.mat"
,
verifiable
);
fileName
=
sprintf
(
"referenceState_%s.mat"
,
verifiable
);
filePath
=
fullfile
(
currentPath
,
'..'
,
'data'
,
'testSimulator'
,
verifiable
,
fileName
);
filePath
=
fullfile
(
currentPath
,
'..'
,
'data'
,
'testSimulator'
,
verifiable
,
fileName
);
...
@@ -35,7 +36,8 @@ classdef TestSimulator < matlab.unittest.TestCase
...
@@ -35,7 +36,8 @@ classdef TestSimulator < matlab.unittest.TestCase
methods
(
TestMethodTeardown
)
methods
(
TestMethodTeardown
)
function
teardown
(
testCase
)
function
teardown
(
testCase
)
close
all
mainSimPath
=
fullfile
(
'..'
,
'..'
,
'simulator'
);
rmpath
(
genpath
(
mainSimPath
));
end
end
end
end
...
@@ -53,10 +55,9 @@ classdef TestSimulator < matlab.unittest.TestCase
...
@@ -53,10 +55,9 @@ classdef TestSimulator < matlab.unittest.TestCase
end
end
methods
(
Static
)
methods
(
Static
)
function
saveTest
(
verifiable
,
mission
,
rocket
,
wind
,
environment
,
settings
)
function
saveTest
(
verifiable
,
rocket
,
wind
,
environment
,
settings
)
Time
=
tic
;
Time
=
tic
;
currentPath
=
fileparts
(
mfilename
(
'fullpath'
));
currentPath
=
fileparts
(
mfilename
(
'fullpath'
));
addpath
(
genpath
(
currentPath
));
disp
(
'Started saving simulator tests'
)
disp
(
'Started saving simulator tests'
)
...
@@ -86,12 +87,10 @@ classdef TestSimulator < matlab.unittest.TestCase
...
@@ -86,12 +87,10 @@ classdef TestSimulator < matlab.unittest.TestCase
end
end
save
(
filePath
,
'stateA'
,
'stateF'
,
'settings'
,
...
save
(
filePath
,
'stateA'
,
'stateF'
,
'settings'
,
...
'mission'
,
'rocket'
,
'environment'
,
'wind'
);
'rocket'
,
'environment'
,
'wind'
);
Time
=
toc
(
Time
);
Time
=
toc
(
Time
);
fprintf
(
'\t %s test created in: %2.2f seconds\n'
,
verifiable
,
Time
)
fprintf
(
'\t %s test created in: %2.2f seconds\n'
,
verifiable
,
Time
)
end
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