Skip to content

Commit e5772a7

Browse files
authored
Add more tests. Refactor testing code. (#45)
1 parent 4f1ccdc commit e5772a7

File tree

903 files changed

+30816
-8632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

903 files changed

+30816
-8632
lines changed

BEV/BEV_system_model.mdl

Lines changed: 21 additions & 22 deletions
Large diffs are not rendered by default.

BEV/Model-Basic/BEV_setup_Basic.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ function BEV_setup_Basic(NameValuePair)
1919
end % if
2020

2121
set_param(model_name + "/Longitudinal Vehicle", ReferencedSubsystem = "Vehicle1D_Basic_refsub");
22-
FileTool2.evalMFile("Vehicle1D_Basic_params")
22+
FileTool3.evalMFile("Vehicle1D_Basic_params")
2323

2424
set_param(model_name + "/High Voltage Battery", ReferencedSubsystem = "BatteryHV_Basic_refsub");
25-
FileTool2.evalMFile("BatteryHV_Basic_params")
25+
FileTool3.evalMFile("BatteryHV_Basic_params")
2626

2727
set_param(model_name + "/Motor Drive Unit", ReferencedSubsystem = "MotorDriveUnit_Basic_refsub");
28-
FileTool2.evalMFile("MotorDriveUnit_Basic_params")
28+
FileTool3.evalMFile("MotorDriveUnit_Basic_params")
2929

3030
set_param(model_name + "/Reduction Gear", ReferencedSubsystem = "Reducer_Basic_refsub");
31-
FileTool2.evalMFile("Reducer_Basic_params")
31+
FileTool3.evalMFile("Reducer_Basic_params")
3232

3333
set_param(model_name + "/Controller and Environment/BEV Controller", ReferencedSubsystem = "BEVController_Basic_refsub");
34-
FileTool2.evalMFile("BEVController_Basic_params")
34+
FileTool3.evalMFile("BEVController_Basic_params")
3535

3636
end % function

BEV/Model-Basic/SimulationCases/uptodatetest_BEV_Basic_SimulationCases.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function markdown_files_exist(testcase)
4343

4444
% Select Live Scripts.
4545
% https://www.mathworks.com/help/matlab/ref/matlab.buildtool.io.filecollection.select.html
46-
live_script_file_collection = select(mfile_collection, @(p) FileTool2.isPlainTextLiveScript(p));
46+
live_script_file_collection = select(mfile_collection, @(p) FileTool3.isPlainTextLiveScript(p));
4747

4848
[folder_path, base_file_name, ~] = fileparts(live_script_file_collection.paths');
4949
markdown_files = fullfile(folder_path, "markdown", base_file_name + ".md");
@@ -60,12 +60,12 @@ function markdown_files_exist(testcase)
6060

6161
function markdowns_are_uptodate(testcase)
6262
% Make sure that all Live Scripts have been converted to markdown files.
63-
n = FileTool2.batchGenerateMarkdowns( ...
63+
n = FileTool3.batchGenerateMarkdowns( ...
6464
LiveScriptFolderNames = pwd, ...
6565
MarkdownFolderPath = "markdown");
6666

6767
if n > 0
68-
n = FileTool2.batchGenerateMarkdowns( ...
68+
n = FileTool3.batchGenerateMarkdowns( ...
6969
LiveScriptFolderNames = pwd, ...
7070
MarkdownFolderPath = "markdown", DisplayInfo = true);
7171
end % if

BEV/Model-Thermal/BEV_setup_Thermal.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ function BEV_setup_Thermal(NameValuePair)
2121
end % if
2222

2323
set_param(model_name + "/Longitudinal Vehicle", ReferencedSubsystem = "Vehicle1D_Basic_refsub");
24-
FileTool2.evalMFile("Vehicle1D_Basic_params")
24+
FileTool3.evalMFile("Vehicle1D_Basic_params")
2525

2626
set_param(model_name + "/High Voltage Battery", ReferencedSubsystem = "BatteryHV_SystemThermal_refsub");
27-
FileTool2.evalMFile("BatteryHV_SystemThermal_params")
27+
FileTool3.evalMFile("BatteryHV_SystemThermal_params")
2828

2929
set_param(model_name + "/Motor Drive Unit", ReferencedSubsystem = "MotorDriveUnit_BasicThermal_refsub");
30-
FileTool2.evalMFile("MotorDriveUnit_BasicThermal_params")
30+
FileTool3.evalMFile("MotorDriveUnit_BasicThermal_params")
3131

3232
set_param(model_name + "/Reduction Gear", ReferencedSubsystem = "Reducer_Basic_refsub");
33-
FileTool2.evalMFile("Reducer_Basic_params")
33+
FileTool3.evalMFile("Reducer_Basic_params")
3434

3535
set_param(model_name + "/Controller and Environment/BEV Controller", ReferencedSubsystem = "BEVController_Basic_refsub");
36-
FileTool2.evalMFile("BEVController_Basic_params")
36+
FileTool3.evalMFile("BEVController_Basic_params")
3737

3838
end % function

BEV/Model-Thermal/SimulationCases/uptodatetest_BEV_Thermal_SimulationCases.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function markdown_files_exist(testcase)
4343

4444
% Select Live Scripts.
4545
% https://www.mathworks.com/help/matlab/ref/matlab.buildtool.io.filecollection.select.html
46-
live_script_file_collection = select(mfile_collection, @(p) FileTool2.isPlainTextLiveScript(p));
46+
live_script_file_collection = select(mfile_collection, @(p) FileTool3.isPlainTextLiveScript(p));
4747

4848
[folder_path, base_file_name, ~] = fileparts(live_script_file_collection.paths');
4949
markdown_files = fullfile(folder_path, "markdown", base_file_name + ".md");
@@ -60,12 +60,12 @@ function markdown_files_exist(testcase)
6060

6161
function markdowns_are_uptodate(testcase)
6262
% Make sure that all Live Scripts have been converted to markdown files.
63-
n = FileTool2.batchGenerateMarkdowns( ...
63+
n = FileTool3.batchGenerateMarkdowns( ...
6464
LiveScriptFolderNames = pwd, ...
6565
MarkdownFolderPath = "markdown");
6666

6767
if n > 0
68-
n = FileTool2.batchGenerateMarkdowns( ...
68+
n = FileTool3.batchGenerateMarkdowns( ...
6969
LiveScriptFolderNames = pwd, ...
7070
MarkdownFolderPath = "markdown", DisplayInfo = true);
7171
end % if

BEV/Utility/BEV_plotResults.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
hold(ax, "on")
6363
grid(ax, "on")
6464
plot(ax, simData, "Time", "Reference Vehicle Speed kph", LineWidth=2)
65-
SignalTool2.setMinimumYRange(ax, simData.("Reference Vehicle Speed kph"), dy_threshold=2);
65+
SignalTool3.setMinimumYRange(ax, simData.("Reference Vehicle Speed kph"), dy_threshold=2);
6666
ylabel(ax, "") % Hide variable name defined in the timetable.
6767
xlim(ax, "tight")
6868
xlabel(ax, "")
@@ -75,7 +75,7 @@
7575
plot(ax, simData, "Time", "G-Force", LineWidth=2)
7676
hold(ax, "on")
7777
grid(ax, "on")
78-
SignalTool2.setMinimumYRange(ax, simData.("G-Force"), dy_threshold=0.02);
78+
SignalTool3.setMinimumYRange(ax, simData.("G-Force"), dy_threshold=0.02);
7979
ylabel(ax, "") % Hide variable name defined in the timetable.
8080
xlim(ax, "tight")
8181
xlabel(ax, "")
@@ -87,7 +87,7 @@
8787
plot(ax, simData, "Time", "Motor Torque Command", LineWidth=2)
8888
hold(ax, "on")
8989
grid(ax, "on")
90-
SignalTool2.setMinimumYRange(ax, simData.("Motor Torque Command"), dy_threshold=2);
90+
SignalTool3.setMinimumYRange(ax, simData.("Motor Torque Command"), dy_threshold=2);
9191
ylabel(ax, "") % Hide variable name defined in the timetable.
9292
xlim(ax, "tight")
9393
xlabel(ax, "")
@@ -100,7 +100,7 @@
100100
plot(ax, simData, "Time", "Motor Temperature", LineWidth=2)
101101
hold(ax, "on")
102102
grid(ax, "on")
103-
SignalTool2.setMinimumYRange(ax, simData.("Motor Temperature"), dy_threshold=2);
103+
SignalTool3.setMinimumYRange(ax, simData.("Motor Temperature"), dy_threshold=2);
104104
ylabel(ax, "") % Hide variable name defined in the timetable.
105105
xlim(ax, "tight")
106106
xlabel(ax, "")
@@ -115,7 +115,7 @@
115115
plot(ax, simData, "Time", "HV Battery SOC", LineWidth=2)
116116
hold(ax, "on")
117117
grid(ax, "on")
118-
SignalTool2.setMinimumYRange(ax, simData.("HV Battery SOC"), dy_threshold=0.2);
118+
SignalTool3.setMinimumYRange(ax, simData.("HV Battery SOC"), dy_threshold=0.2);
119119
ylabel(ax, "") % Hide variable name defined in the timetable.
120120
xlim(ax, "tight")
121121
xlabel(ax, "")
@@ -127,7 +127,7 @@
127127
plot(ax, simData, "Time", "HV Battery Current", LineWidth=2)
128128
hold(ax, "on")
129129
grid(ax, "on")
130-
SignalTool2.setMinimumYRange(ax, simData.("HV Battery Current"), dy_threshold=2);
130+
SignalTool3.setMinimumYRange(ax, simData.("HV Battery Current"), dy_threshold=2);
131131
ylabel(ax, "") % Hide variable name defined in the timetable.
132132
xlim(ax, "tight")
133133
xlabel(ax, "")
@@ -139,7 +139,7 @@
139139
plot(ax, simData, "Time", "HV Battery Power", LineWidth=2)
140140
hold(ax, "on")
141141
grid(ax, "on")
142-
SignalTool2.setMinimumYRange(ax, simData.("HV Battery Power"), dy_threshold=2);
142+
SignalTool3.setMinimumYRange(ax, simData.("HV Battery Power"), dy_threshold=2);
143143
ylabel(ax, "") % Hide variable name defined in the timetable.
144144
xlim(ax, "tight")
145145
xlabel(ax, "")
@@ -152,7 +152,7 @@
152152
plot(ax, simData, "Time", "HV Battery Temperature", LineWidth=2)
153153
hold(ax, "on")
154154
grid(ax, "on")
155-
SignalTool2.setMinimumYRange(ax, simData.("HV Battery Temperature"), dy_threshold=2);
155+
SignalTool3.setMinimumYRange(ax, simData.("HV Battery Temperature"), dy_threshold=2);
156156
ylabel(ax, "") % Hide variable name defined in the timetable.
157157
xlim(ax, "tight")
158158
xlabel(ax, "")
0 Bytes
Loading
0 Bytes
Loading

0 commit comments

Comments
 (0)