Skip to content

Commit 9d30f63

Browse files
committed
Maintenance for R2025b
Update to new startup app Improve ci.yml Standardize project details Remove reference to emailing for solutions in README as the solutions are included in Instructor Resources Update identity as the MathWorks Educator Content Development team
1 parent 96dcc14 commit 9d30f63

File tree

98 files changed

+479
-198
lines changed

Some content is hidden

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

98 files changed

+479
-198
lines changed

.github/workflows/ci.yml

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

MainMenu.mlx

-1.18 KB
Binary file not shown.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The instructions inside the live scripts will guide you through the exercises an
2424

2525
## Contact Us
2626

27-
Solutions are available upon instructor request. Contact the [MathWorks teaching resources team](mailto:[email protected]) if you would like to request solutions, provide feedback, or if you have a question.
27+
Contact the [MathWorks Educator Content Development Team](mailto:[email protected]) if you would like to provide feedback, or if you have a question.
2828

2929

3030
## Prerequisites
@@ -90,13 +90,13 @@ Or feel free to explore our other [modular courseware content](https://www.mathw
9090

9191
# Contribute
9292

93-
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks teaching resources team](mailto:%[email protected]). If you want to contribute directly to this project, you can find information about how to do so in the [CONTRIBUTING.md](https://github.com/MathWorks-Teaching-Resources/Probability-Theory/blob/release/CONTRIBUTING.md) page on GitHub.
93+
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks Educator Content Development Team](mailto:%[email protected]). If you want to contribute directly to this project, you can find information about how to do so in the [CONTRIBUTING.md](https://github.com/MathWorks-Teaching-Resources/Probability-Theory/blob/release/CONTRIBUTING.md) page on GitHub.
9494

9595
# License
9696

9797
You can find the [license](https://github.com/MathWorks-Teaching-Resources/Probability-Theory/blob/release/LICENSE.md) for this module on GitHub.
9898

9999

100-
*©* Copyright 2023 The MathWorks, Inc
100+
*©* Copyright 2025 The MathWorks, Inc
101101

102102

README.mlx

-25 Bytes
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: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@
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

1718
function File = RetrieveFile(Project) %#ok<INUSD>
1819
% Retrieve student template files:
1920
RootFolder = currentProject().RootFolder;
20-
File = dir(fullfile(RootFolder,"Scripts","*.mlx"));
21+
File = dir(fullfile(RootFolder,"Scripts","*.m"));
22+
File = [File; dir(fullfile(RootFolder,"Scripts","*.mlx"))];
2123
File = {File.name};
2224
end
2325

24-
end
26+
end % Static TestParameterDefinition
2527

2628
methods (TestClassSetup)
2729

@@ -37,8 +39,28 @@ function SetUpSmokeTest(testCase,Project) %#ok<INUSD>
3739
testCase.log("Running in " + version)
3840
end
3941

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

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

4466
function SmokeRun(testCase,File)
@@ -90,13 +112,13 @@ function SmokeRun(testCase,File)
90112

91113
end
92114

93-
end
115+
end % Test Methods
94116

95117

96118
methods (Access = private)
97119

98120
function Path = CheckPreFile(testCase,Filename)
99-
PreFile = "Pre"+replace(Filename,".mlx",".m");
121+
PreFile = "Pre"+extractBefore(Filename,".m")+".m";
100122
PreFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PreFiles",PreFile);
101123
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
102124
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
@@ -112,7 +134,7 @@ function SmokeRun(testCase,File)
112134
end
113135

114136
function Path = CheckPostFile(testCase,Filename)
115-
PostFile = "Post"+replace(Filename,".mlx",".m");
137+
PostFile = "Post"+extractBefore(Filename,".m")+".m";
116138
PostFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PostFiles",PostFile);
117139
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
118140
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
@@ -125,6 +147,6 @@ function SmokeRun(testCase,File)
125147
Path = PostFilePath;
126148
end
127149

128-
end
150+
end % Private Methods
129151

130-
end
152+
end % Smoketests

SoftwareTests/SolnSmokeTests.m

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,48 @@
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;
21-
File = dir(fullfile(RootFolder,"Scripts","*.mlx"));
22-
File = {File.name};
42+
File = dir(fullfile(RootFolder,"Scripts","*.m"));
43+
File = [File; dir(fullfile(RootFolder,"Scripts","*.mlx"))];
44+
File = {File.name};
2345
end
2446

25-
end
47+
end % Static TestParameterDefinition
2648

2749
methods (TestClassSetup)
2850

@@ -34,7 +56,7 @@ function SetUpPath(testCase,Project)
3456
% Check that solutions are on path:
3557
testCase.isSolnOnPath = isfolder("Solutions");
3658
if testCase.isSolnOnPath == 0
37-
addpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions"))
59+
addpath(genpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions")))
3860
end
3961

4062
% Close the StartUp app if still open:
@@ -52,16 +74,16 @@ function SetUpPath(testCase,Project)
5274
% Check that solutions files exist for each of the student
5375
% templates
5476
function ExistSolns(testCase,File)
55-
SolutionName = replace(string(File),".mlx","Soln.mlx");
77+
SolutionName = replace(string(File),".m","Soln.m");
5678
assert(exist(SolutionName,"file"),"Missing solutions for "+File);
57-
end
79+
end
5880

5981

6082
function SmokeRun(testCase,File)
6183

6284
% Navigate to project root folder:
6385
cd(testCase.RootFolder)
64-
FileToRun = replace(string(File),".mlx","Soln.mlx");
86+
FileToRun = replace(string(File),".m","Soln.m");
6587

6688
% Pre-test:
6789
PreFiles = CheckPreFile(testCase,FileToRun);
@@ -106,12 +128,12 @@ function SmokeRun(testCase,File)
106128

107129
end
108130

109-
end
110-
131+
end % Test Methods
132+
111133
methods (Access = private)
112134

113135
function Path = CheckPreFile(testCase,Filename)
114-
PreFile = "Pre"+replace(Filename,".mlx",".m");
136+
PreFile = "Pre"+extractBefore(Filename,".m")+".m";
115137
PreFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PreFiles",PreFile);
116138
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
117139
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
@@ -127,7 +149,7 @@ function SmokeRun(testCase,File)
127149
end
128150

129151
function Path = CheckPostFile(testCase,Filename)
130-
PostFile = "Post"+replace(Filename,".mlx",".m");
152+
PostFile = "Post"+extractBefore(Filename,".m")+".m";
131153
PostFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PostFiles",PostFile);
132154
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
133155
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
@@ -140,6 +162,16 @@ function SmokeRun(testCase,File)
140162
Path = PostFilePath;
141163
end
142164

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

145-
end
177+
end % SolnSmokeTests

0 commit comments

Comments
 (0)