Skip to content

Commit 194b569

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 f3dee7b commit 194b569

File tree

18 files changed

+200
-192
lines changed

18 files changed

+200
-192
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 10 deletions
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]
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
@@ -34,19 +36,11 @@ jobs:
3436
echo "DISPLAY=:99" >> $GITHUB_ENV
3537
3638
# Sets up MATLAB
37-
- name: Setup MATLAB
39+
- name: Setup MATLAB
3840
uses: matlab-actions/setup-matlab@v2
3941
with:
4042
release: ${{ matrix.MATLABVersion }}
4143
products: MATLAB Symbolic_Math_Toolbox Deep_Learning_Toolbox
42-
# List required products above in the format shown (and uncomment them)
43-
# List of product strings:
44-
# Simulink
45-
# Statistics_and_Machine_Learning_Toolbox
46-
# Simulink_Coder
47-
# Econometrics_Toolbox
48-
# Deep_Learning_Toolbox
49-
5044

5145
# Run all the tests
5246
- name: Run SmokeTests

Images/TestedWith.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"schemaVersion":1,"label":"Test Status","color":"success","message":"R2024a | R2024b"}
1+
{"schemaVersion":1,"label":"Test Status","color":"success","message":"R2024b | R2025a"}

MainMenu.mlx

28 Bytes
Binary file not shown.

README.md

Lines changed: 2 additions & 2 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
@@ -99,6 +99,6 @@ Feel free to explore our other [modular courseware content](https://www.mathwork
9999
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/Mechanics-of-Materials/blob/release/CONTRIBUTING.md) page on GitHub.
100100

101101

102-
*©* Copyright 2023 The MathWorks, Inc
102+
*©* Copyright 2025 The MathWorks, Inc
103103

104104

README.mlx

-19 Bytes
Binary file not shown.

SoftwareTests/FunctionTests.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
classdef FunctionTests < matlab.unittest.TestCase
22

3+
% https://www.mathworks.com/help/matlab/matlab_prog/use-parameters-in-class-based-tests.html
4+
35
methods(Test)
46

57
end % methods

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/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

0 commit comments

Comments
 (0)