Skip to content
Snippets Groups Projects
Commit 6b497b03 authored by Lorenzo Amici's avatar Lorenzo Amici Committed by Marco Luigi Gaibotti
Browse files

[unit-test][unitTestClasses] Added main and confing scripts

parent a3f3a55c
Branches
Tags
1 merge request!12Unit test
% config unit-test
%% UNIT TESTS TO RUN
% choose which folders to test
opt.testSimulator = false;
opt.testCommonFunction = true;
opt.testApogeeAnalysis = true;
opt.testOptimization = false;
opt.testSensitivity = true;
%% UNIT TEST TO CREATE
% choose which folders to create data for
opt.createTestSimulator = false;
opt.createTestCommonFunction = true;
opt.createTestApogeeAnalysis = true;
opt.createTestOptimization = false;
opt.createTestSensitivity = true;
% main unit-test
currentPath = fileparts(mfilename('fullpath'));
cd (currentPath);
addpath(genpath(currentPath));
configUnitTest;
%% TESTS
beginTest = tic;
if opt.testSimulator
test = TestSimulator();
test.createTest;
simResults = run(test);
end
if opt.testCommonFunction
test = TestCommonFunctions();
test.createTest;
testcmnfnctResults = run(test);
end
if opt.testApogeeAnalysis
test = TestApogeeAnalysis();
test.createTest;
apoResults = run(test);
end
if opt.testOptimization
test = TestOptimization();
test.createTest;
optResults = run(test);
end
if opt.testSensitivity
test = TestSensitivity();
test.createTest;
sensResults = run(test);
end
toc(beginTest)
\ No newline at end of file
% save tests
filePath = fileparts(mfilename('fullpath'));
cd (filePath);
addpath(genpath(currentPath));
configUnitTest;
totTime = tic;
%% CREATING SIMULATOR TESTS
if opt.createTestSimulator
test = TestSimulator();
test.saveTest();
end
%% TEST COMMONFUNCTIONS
if opt.createTestCommonFunction
test = TestCommonFunctions();
test.saveTest();
end
%% TEST APOGEE ANALYSIS
if opt.createTestApogeeAnalysis
test = TestApogeeAnalysis();
test.saveTest();
end
%% SENSITIVITY ANALYSIS
if opt.createTestSensitivity
test = TestSensitivity();
test.saveTest();
end
%% OPTIMIZATION
if opt.createTestOptimization
test = TestOptimization();
test.saveTest();
end
totTimeF = toc(totTime);
fprintf('\n\n All unit tests created in: %2.2f seconds\n\n', totTimeF)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment