-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b75db1
commit 0f5c24b
Showing
63 changed files
with
282 additions
and
38 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
% Copyright 2022 - 2023 The MathWorks, Inc. | ||
|
||
web('BatteryElectricVehicleModelOverview.html') |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
%% Script to run unit tests | ||
% This script runs all the unit tests that are the child classes of | ||
% matlab.unittest.TestCase in the project. | ||
% Unit test classes are automatically detected by | ||
% the matlab.unittest.TestSuite.fromFolder function. | ||
|
||
% Copyright 2021-2022 The MathWorks, Inc. | ||
|
||
relstr = matlabRelease().Release; | ||
disp("This is MATLAB " + relstr + ".") | ||
|
||
%% Create test suite | ||
|
||
prjRoot = currentProject().RootFolder; | ||
|
||
suite_1 = matlab.unittest.TestSuite.fromFolder( ... | ||
fullfile(prjRoot, "Components\BatteryHV"), IncludingSubfolders = true); | ||
|
||
suite_2 = matlab.unittest.TestSuite.fromFile( ... | ||
fullfile(prjRoot, "Test", "BEV_System_UnitTest_MQC.m")); | ||
|
||
suite_3 = matlab.unittest.TestSuite.fromFolder( ... | ||
fullfile(prjRoot, "Components\MotorDrive"), IncludingSubfolders = true); | ||
|
||
|
||
|
||
suite = [suite_1 suite_2 suite_3]; | ||
|
||
%% Create test runner | ||
|
||
runner = matlab.unittest.TestRunner.withTextOutput( ... | ||
"OutputDetail", matlab.unittest.Verbosity.Detailed); | ||
|
||
%% JUnit style test result | ||
|
||
plugin = matlab.unittest.plugins.XMLPlugin.producingJUnitFormat( ... | ||
fullfile(prjRoot,"Test", "TestResults_"+relstr+".xml")); | ||
|
||
addPlugin(runner, plugin) | ||
|
||
|
||
%% Code Coverage Report Plugin | ||
coverageReportFolder = fullfile(currentProject().RootFolder,"", "coverage" + relstr); | ||
if ~isfolder(coverageReportFolder) | ||
mkdir(coverageReportFolder) | ||
end | ||
coverageReport = matlab.unittest.plugins.codecoverage.CoverageReport(coverageReportFolder, MainFile = "BEV_MQC_Coverage_" + relstr + ".html" ); | ||
|
||
%% Code Coverage Plugin | ||
list = dir(fullfile(prjRoot, 'Script_Data')); | ||
list = list(~[list.isdir] & startsWith({list.name}, 'BEV') & endsWith({list.name}, {'.m', '.mlx'})); | ||
fileList = arrayfun(@(x)[x.folder, filesep, x.name], list, 'UniformOutput', false); | ||
codeCoveragePlugin = matlab.unittest.plugins.CodeCoveragePlugin.forFile(fileList, Producing = coverageReport ); | ||
addPlugin(runner, codeCoveragePlugin); | ||
|
||
|
||
%% Run tests | ||
|
||
results = run(runner, suite); | ||
|
||
assertSuccess(results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
classdef BEV_System_UnitTest_MQC < matlab.unittest.TestCase | ||
%% Class implementation of unit test | ||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
%% Simple tests ... just run runnables | ||
|
||
|
||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
properties | ||
openfigureListBefore; | ||
end | ||
|
||
methods(TestMethodSetup) | ||
function listOpenFigures(test) | ||
% List all open figures | ||
test.openfigureListBefore = findall(0,'Type','Figure'); | ||
end | ||
|
||
function setupWorkingFolder(test) | ||
% Set up working folder | ||
import matlab.unittest.fixtures.WorkingFolderFixture; | ||
test.applyFixture(WorkingFolderFixture); | ||
end | ||
end | ||
|
||
|
||
methods (Test) | ||
|
||
|
||
%% Harness folder | ||
|
||
function MQC_System_1(testCase) | ||
mdl = "BEVsystemModel"; | ||
load_system(mdl) | ||
testCase.addTeardown(@()close_system(mdl, 0)); | ||
sim(mdl); | ||
|
||
end | ||
|
||
function MQC_System_2(testCase) | ||
mdl = "BEVsystemModel"; | ||
load_system(mdl) | ||
set_param('BEVsystemModel/Vehicle', 'ReferencedSubsystem', 'VehicleElec') | ||
testCase.addTeardown(@()close_system(mdl, 0)); | ||
sim(mdl); | ||
|
||
end | ||
|
||
function MQC_System_3(testCase) | ||
mdl = "BEVsystemModel"; | ||
load_system(mdl) | ||
set_param('BEVsystemModel/Vehicle', 'ReferencedSubsystem', 'VehicleElectroThermal') | ||
set_param('BEVsystemModel/Vehicle/Battery', 'ReferencedSubsystem', 'BatteryPlantModel_Table') | ||
testCase.addTeardown(@()close_system(mdl, 0)); | ||
sim(mdl); | ||
|
||
end | ||
|
||
function test_BEVRangeEstimationMainMLX(test) | ||
%The test runs the |.mlx| file and makes sure that there are | ||
%no errors or warning thrown. | ||
test.verifyWarningFree(@()run_BEVRangeEstimationMain, "'BEVRangeEstimationMain mlx' should execute wihtout any warning or error."); | ||
end | ||
function test_BEVBatterySizingMainMLX(test) | ||
%The test runs the |.mlx| file and makes sure that there are | ||
%no errors or warning thrown. | ||
test.verifyWarningFree(@()run_BEVBatterySizingMain, "'BEVRangeEstimationMain mlx' should execute wihtout any warning or error."); | ||
end | ||
end | ||
|
||
end % classdef | ||
|
||
|
||
|
||
function run_BEVRangeEstimationMain() | ||
% Function runs the |.mlx| script. | ||
BEVRangeEstimationMain; | ||
end | ||
|
||
function run_BEVBatterySizingMain() | ||
% Function runs the |.mlx| script. | ||
BEVBatterySizingMain; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
% This test checks if project status is passed | ||
% Copyright 2023 The MathWorks, Inc. | ||
|
||
|
||
relstr = matlabRelease().Release; | ||
disp("This is MATLAB " + relstr + "."); | ||
|
||
prj = currentProject; | ||
updateDependencies(prj); | ||
checkResults = runChecks(prj); | ||
resultTable = table(checkResults); % *.Passed, *.ID, *.Description | ||
disp(resultTable(:, ["Passed", "Description"])); | ||
|
||
assert(all(resultTable.Passed==true)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
%% Run unit tests | ||
% This script runs unit tests and generates a test result summary in XML | ||
% and a MATLAB code coverage report in HTML. | ||
|
||
% Copyright 2022 The MathWorks, Inc. | ||
|
||
relstr = matlabRelease().Release; | ||
disp("This is MATLAB " + relstr + ".") | ||
|
||
prjroot = currentProject().RootFolder; | ||
|
||
%% Create test suite | ||
|
||
suite = matlab.unittest.TestSuite.fromFile( ... | ||
fullfile(prjroot, "Test", "CheckProject", "BEVProject_CheckProject.m")); | ||
|
||
%% Create test runner | ||
|
||
runner = matlab.unittest.TestRunner.withTextOutput( ... | ||
OutputDetail = matlab.unittest.Verbosity.Detailed ); | ||
|
||
%% JUnit Style Test Result | ||
|
||
plugin = matlab.unittest.plugins.XMLPlugin.producingJUnitFormat( ... | ||
fullfile(prjroot, "Test", "CheckProject", "TestResults_"+relstr+".xml")); | ||
|
||
addPlugin(runner, plugin) | ||
|
||
%% Run tests | ||
|
||
results = run(runner, suite); | ||
|
||
assertSuccess(results) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions
2
resources/project/EEtUlUb-dLAdf0KpMVivaUlztwA/OgkEYh-KkD9715dHiCMw0uZewEAp.xml
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...vaUlztwA/OgkEYh-KkD9715dHiCMw0uZewEAd.xml → ...vaUlztwA/U0rk1rAT1l1NBnp-5vSjFpvi_40d.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info Ref="test" Type="Relative"/> | ||
<Info Ref="Test" Type="Relative"/> |
2 changes: 2 additions & 0 deletions
2
resources/project/EEtUlUb-dLAdf0KpMVivaUlztwA/U0rk1rAT1l1NBnp-5vSjFpvi_40p.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="76347f5f-dfd6-45ae-bc43-0f70a5e530d5" type="Reference"/> |
2 changes: 2 additions & 0 deletions
2
resources/project/EEtUlUb-dLAdf0KpMVivaUlztwA/v-tzBr8pfyaFm6w8mGO471YTEcAd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info Ref="Test/CheckProject" Type="Relative"/> |
2 changes: 2 additions & 0 deletions
2
resources/project/EEtUlUb-dLAdf0KpMVivaUlztwA/v-tzBr8pfyaFm6w8mGO471YTEcAp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="1a7a1b19-82a6-4e4d-aaba-fbf6e42e2b2d" type="Reference"/> |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
resources/project/IbgIeXlrI1LgUg9BqlL3VBmsnjI/jy-aAbSLb3UPtIsl8jYsSPYH-IUp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="OpenElectricVehicleModelOverview.m" type="File"/> |
2 changes: 1 addition & 1 deletion
2
resources/project/KAXfQgCar2Yb8zOxgvf9hdmLP1E/WU0Wty6gx3PMVBPMmNupO8KmR9sd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info Type="StartUp" Visible="1" Icon="" File="Script_Data/OpenElectricVehicleSimscape.m" Name="Open Overview"/> | ||
<Info Type="StartUp" Visible="1" Icon="" File="Script_Data/OpenElectricVehicleSimscape.m" Name="Open Project Overview"/> |
2 changes: 2 additions & 0 deletions
2
resources/project/KAXfQgCar2Yb8zOxgvf9hdmLP1E/bbNoBUzH9baTgB_VYaEaSURl54Yd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info Type="Basic" GroupUUID="" Visible="1" Icon="" File="Script_Data/OpenElectricVehicleModelOverview.m" Name="Electric Vehicle Model Overview"/> |
2 changes: 2 additions & 0 deletions
2
resources/project/KAXfQgCar2Yb8zOxgvf9hdmLP1E/bbNoBUzH9baTgB_VYaEaSURl54Yp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="af130f8e-79f8-4063-b27b-4c6342079159" type="EntryPoint"/> |
2 changes: 0 additions & 2 deletions
2
resources/project/KAXfQgCar2Yb8zOxgvf9hdmLP1E/wnPswUdwFCDR6b_chhA3pax1RJ0d.xml
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
resources/project/KAXfQgCar2Yb8zOxgvf9hdmLP1E/wnPswUdwFCDR6b_chhA3pax1RJ0p.xml
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
resources/project/KFo_Dwac-c6l-izxoptPkC0Bs88/LY5cwZa0hGuCHPq0cMuvNM88u8gp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="BEVProject_Tests.m" type="File"/> |
6 changes: 6 additions & 0 deletions
6
resources/project/KFo_Dwac-c6l-izxoptPkC0Bs88/P6iqAF7dQ2lR4sDG3tvaskNbQ-8d.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info> | ||
<Category UUID="FileClassCategory"> | ||
<Label UUID="7d2f3aeb-7c63-4ab3-935b-ad0e0b73334f"/> | ||
</Category> | ||
</Info> |
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
resources/project/KFo_Dwac-c6l-izxoptPkC0Bs88/TL4jQ9ITEqxL9v6NLVC_RGV-eMkd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info> | ||
<Category UUID="FileClassCategory"> | ||
<Label UUID="7d2f3aeb-7c63-4ab3-935b-ad0e0b73334f"/> | ||
</Category> | ||
</Info> |
2 changes: 2 additions & 0 deletions
2
resources/project/KFo_Dwac-c6l-izxoptPkC0Bs88/TL4jQ9ITEqxL9v6NLVC_RGV-eMkp.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="BEV_System_UnitTest_MQC.m" type="File"/> |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...1GMfrjbQ/FI0gxbH-PhwjE_riDQGHPyYMHksp.xml → ...PkC0Bs88/mwsoitc0armw0owo2qnwO2B46qod.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="test" type="File"/> | ||
<Info/> |
2 changes: 2 additions & 0 deletions
2
resources/project/KFo_Dwac-c6l-izxoptPkC0Bs88/mwsoitc0armw0owo2qnwO2B46qop.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info location="CheckProject" type="File"/> |
2 changes: 1 addition & 1 deletion
2
resources/project/NorccSwEK73TjZgjKiLmL5jUn7w/T1sseH-L59H8o7Lwx0dPc3HJRx0d.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info> | ||
<Category UUID="FileClassCategory"> | ||
<Label UUID="design"/> | ||
<Label UUID="7d2f3aeb-7c63-4ab3-935b-ad0e0b73334f"/> | ||
</Category> | ||
</Info> |
6 changes: 6 additions & 0 deletions
6
resources/project/S1Lil1iOsqExZxnxR5UuULoyCSw/l67fkq3jWKBNBgv7OqgWS0LZvI0d.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info> | ||
<Category UUID="FileClassCategory"> | ||
<Label UUID="7d2f3aeb-7c63-4ab3-935b-ad0e0b73334f"/> | ||
</Category> | ||
</Info> |
Oops, something went wrong.