Skip to content

Commit d1d1711

Browse files
committed
Maintenance cycle R2025b
1 parent 87d405c commit d1d1711

37 files changed

Lines changed: 253 additions & 286 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
MATLABVersion: [R2024a,R2024b]
22+
MATLABVersion: [R2024b,R2025a]
2323
runs-on: ubuntu-latest
24-
steps:
24+
env:
25+
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
26+
steps:
2527
# Checks-out your repository
2628
- uses: actions/checkout@v4
2729

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can use these live scripts as demonstrations in lectures, class activities,
2121

2222
## Contact Us
2323

24-
Contact the [MathWorks teaching resources team](mailto:onlineteaching@mathworks.com) if you would like to provide feedback, or if you have a question.
24+
Contact the [MathWorks Educator Content Development Team](mailto:onlineteaching@mathworks.com) if you would like to provide feedback, or if you have a question.
2525

2626

2727
## Prerequisites

README.mlx

-6 Bytes
Binary file not shown.

Scripts/TreasureHuntAdvanced.mlx

-34.5 KB
Binary file not shown.

SoftwareTests/PostSmokeTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function PostSmokeTest(ShowReport)
3232
% Format the results in a table and save them
3333
Results = table(Results');
3434
Version = extractBetween(string(Results.Name),"Version=",")");
35-
Passed = Results.Passed;
35+
Passed = logical(Results.Passed);
3636

3737
% Add link to other report
3838
File = fileread(fullfile("public","index.html"));
@@ -51,7 +51,7 @@ function PostSmokeTest(ShowReport)
5151
Badge.message = join("R"+Version," | ");
5252
elseif any(Passed)
5353
Badge.color = "yellowgreen";
54-
Badge.message = join("R")
54+
Badge.message = join("R"+Version(Passed)," | ");
5555
elseif all(~Passed)
5656
Badge.color = "critical";
5757
Badge.message = join("R"+Version," | ");

SoftwareTests/SmokeTests.m

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
properties
44
RootFolder
5-
end
5+
sparedEditors % Files already open when the test starts
6+
end % properties
67

78
properties (ClassSetupParameter)
89
Project = {currentProject()};
9-
end
10+
end % ClassSetupParameter
1011

1112
properties (TestParameter)
1213
File;
13-
end
14+
end % TestParameter
1415

1516
methods (TestParameterDefinition,Static)
1617

@@ -21,7 +22,7 @@
2122
File = {File.name};
2223
end
2324

24-
end
25+
end % Static TestParameterDefinition
2526

2627
methods (TestClassSetup)
2728

@@ -37,8 +38,28 @@ function SetUpSmokeTest(testCase,Project) %#ok<INUSD>
3738
testCase.log("Running in " + version)
3839
end
3940

40-
end
41+
end % TestClassSetup
42+
43+
methods(TestMethodSetup)
44+
function recordEditorsToSpare(testCase)
45+
testCase.sparedEditors = matlab.desktop.editor.getAll;
46+
testCase.sparedEditors = {testCase.sparedEditors.Filename};
47+
end
48+
end % TestMethodSetup
4149

50+
methods(TestMethodTeardown)
51+
function closeOpenedEditors_thenDeleteWorkingDir(testCase)
52+
openEditors = matlab.desktop.editor.getAll;
53+
for editor=openEditors(1:end)
54+
if any(strcmp(editor.Filename, testCase.sparedEditors))
55+
continue;
56+
end
57+
% if not on our list, close the file
58+
editor.close();
59+
end
60+
end
61+
end % TestMethodTeardown
62+
4263
methods(Test)
4364

4465
function SmokeRun(testCase,File)
@@ -90,7 +111,7 @@ function SmokeRun(testCase,File)
90111

91112
end
92113

93-
end
114+
end % Test Methods
94115

95116

96117
methods (Access = private)
@@ -125,6 +146,6 @@ function SmokeRun(testCase,File)
125146
Path = PostFilePath;
126147
end
127148

128-
end
149+
end % Private Methods
129150

130-
end
151+
end % Smoketests

SoftwareTests/SolnSmokeTests.m

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,47 @@
33
properties
44
RootFolder
55
isSolnOnPath
6-
end
6+
sparedEditors % Track open files
7+
end % properties
78

89
properties (ClassSetupParameter)
910
Project = {currentProject()};
10-
end
11+
end % ClassSetupParameter
12+
13+
methods(TestMethodSetup)
14+
function recordEditorsToSpare(testCase)
15+
testCase.sparedEditors = matlab.desktop.editor.getAll;
16+
testCase.sparedEditors = {testCase.sparedEditors.Filename};
17+
end
18+
end % TestMethodSetup
19+
20+
methods(TestMethodTeardown)
21+
function closeOpenedEditors_thenDeleteWorkingDir(testCase)
22+
openEditors = matlab.desktop.editor.getAll;
23+
for editor=openEditors(1:end)
24+
if any(strcmp(editor.Filename, testCase.sparedEditors))
25+
continue;
26+
end
27+
% if not on our list, close the file
28+
editor.close();
29+
end
30+
end
31+
end % TestMethodTeardown
1132

1233
properties (TestParameter)
1334
File;
14-
end
35+
end % TestParameter
1536

1637
methods (TestParameterDefinition,Static)
1738

1839
function File = GetScriptName(Project)
1940
% Retrieve student template files:
2041
RootFolder = Project.RootFolder;
2142
File = dir(fullfile(RootFolder,"Scripts","*.mlx"));
22-
File = {File.name};
43+
File = {File.name};
2344
end
2445

25-
end
46+
end % Static TestParameterDefinition
2647

2748
methods (TestClassSetup)
2849

@@ -34,7 +55,7 @@ function SetUpPath(testCase,Project)
3455
% Check that solutions are on path:
3556
testCase.isSolnOnPath = isfolder("Solutions");
3657
if testCase.isSolnOnPath == 0
37-
addpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions"))
58+
addpath(genpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions")))
3859
end
3960

4061
% Close the StartUp app if still open:
@@ -54,7 +75,7 @@ function SetUpPath(testCase,Project)
5475
function ExistSolns(testCase,File)
5576
SolutionName = replace(string(File),".mlx","Soln.mlx");
5677
assert(exist(SolutionName,"file"),"Missing solutions for "+File);
57-
end
78+
end
5879

5980

6081
function SmokeRun(testCase,File)
@@ -106,8 +127,8 @@ function SmokeRun(testCase,File)
106127

107128
end
108129

109-
end
110-
130+
end % Test Methods
131+
111132
methods (Access = private)
112133

113134
function Path = CheckPreFile(testCase,Filename)
@@ -140,6 +161,16 @@ function SmokeRun(testCase,File)
140161
Path = PostFilePath;
141162
end
142163

143-
end
164+
end % Private Access Methods
165+
166+
methods (TestClassTeardown)
167+
168+
function ResetPath(testCase)
169+
if ~testCase.isSolnOnPath && exist("Solutions","dir")
170+
rmpath(genpath(fullfile(currentProject().RootFolder,"InstructorResources","Solutions")))
171+
end
172+
end
173+
174+
end % TestClassTeardown
144175

145-
end
176+
end % SolnSmokeTests

Utilities/ProjectSettings.mat

0 Bytes
Binary file not shown.

Utilities/ProjectStartup.m

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)