Skip to content

Commit 4785ad0

Browse files
committed
Maintenance for R2025b
Merge branch 'update-release' into release
2 parents d3b7353 + 9ac4bf9 commit 4785ad0

File tree

172 files changed

+672
-286
lines changed

Some content is hidden

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

172 files changed

+672
-286
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

.gitlab-ci.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.
-125 KB
Binary file not shown.

MainMenu.mlx

-2 Bytes
Binary file not shown.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
# <span style="color:rgb(213,80,0)">Calculus: Derivatives</span>
33

4+
Learn how to calculate derivatives, understand and use the product and chain rules, and compute Taylor polynomials.
45

56
[![View on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/99249-calculus-derivatives) or [![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=MathWorks-Teaching-Resources/Calculus-Derivatives&project=Derivatives.prj&file=README.mlx)
67

@@ -23,7 +24,7 @@ The instructions inside the live scripts will guide you through the exercises an
2324

2425
## Contact Us
2526

26-
Solutions are available upon instructor request. Contact the [MathWorks teaching resources team](mailto:onlineteaching@mathworks.com) if you would like to request solutions, provide feedback, or if you have a question.
27+
Contact the [MathWorks Educator Content Development Team](mailto:onlineteaching@mathworks.com) if you would like to request assistance, provide feedback, or if you have a question.
2728

2829

2930
## Prerequisites
@@ -111,14 +112,14 @@ The license for this module is available in the [LICENSE.md](https://github.com/
111112
| | | |
112113

113114

114-
Or feel free to explore our other [modular courseware content](https://www.mathworks.com/matlabcentral/fileexchange/?q=tag%3A%22courseware+module%22&sort=downloads_desc_30d).
115+
Or feel free to explore our other [modular courseware content](https://www.mathworks.com/matlabcentral/fileexchange/?q=author%3A%22MathWorks+Educator+Content+Development+Team%22&sort=relevancy).
115116

116117
# Educator Resources
117118
- [Educator Page](https://www.mathworks.com/academia/educators.html)
118119

119120
# Contribute
120121

121-
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks teaching resources team](mailto:%20onlineteaching@mathworks.com). 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/Calculus-Derivatives/blob/release/CONTRIBUTING.md) page on GitHub.
122+
Looking for more? Find an issue? Have a suggestion? Please contact the [MathWorks Educator Content Development Team](mailto:%20onlineteaching@mathworks.com). 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/Calculus-Derivatives/blob/release/CONTRIBUTING.md) page on GitHub.
122123

123124

124125
*©* Copyright 2023 The MathWorks™, Inc

README.mlx

-1 Bytes
Binary file not shown.

Scripts/Definition.mlx

64 Bytes
Binary file not shown.

SoftwareTests/PostSmokeTest.m

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function PostSmokeTest(ShowReport)
3131

3232
% Format the results in a table and save them
3333
Results = table(Results');
34-
Results = Results(Results.Passed,:);
3534
Version = extractBetween(string(Results.Name),"Version=",")");
35+
Passed = logical(Results.Passed);
3636

3737
% Add link to other report
3838
File = fileread(fullfile("public","index.html"));
@@ -45,13 +45,16 @@ function PostSmokeTest(ShowReport)
4545
% Format the JSON file
4646
Badge = struct;
4747
Badge.schemaVersion = 1;
48-
Badge.label = "Tested with";
49-
if size(Results,1) >= 1
50-
Badge.color = "success"
48+
Badge.label = "Test Status";
49+
if all(Passed)
50+
Badge.color = "success";
51+
Badge.message = join("R"+Version," | ");
52+
elseif any(Passed)
53+
Badge.color = "yellowgreen";
54+
Badge.message = join("R"+Version(Passed)," | ");
55+
elseif all(~Passed)
56+
Badge.color = "critical";
5157
Badge.message = join("R"+Version," | ");
52-
else
53-
Badge.color = "failure";
54-
Badge.message = "Pipeline fails";
5558
end
5659
Badge = jsonencode(Badge);
5760
writelines(Badge,fullfile("Images","TestedWith.json"));

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: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ function closeOpenedEditors_thenDeleteWorkingDir(testCase)
3939
function File = GetScriptName(Project)
4040
% Retrieve student template files:
4141
RootFolder = Project.RootFolder;
42-
File = dir(fullfile(RootFolder,"Scripts","*.mlx"));
42+
File = dir(fullfile(RootFolder,"Scripts","*.m"));
43+
File = [File; dir(fullfile(RootFolder,"Scripts","*.mlx"))];
4344
File = {File.name};
4445
end
4546

@@ -55,7 +56,7 @@ function SetUpPath(testCase,Project)
5556
% Check that solutions are on path:
5657
testCase.isSolnOnPath = isfolder("Solutions");
5758
if testCase.isSolnOnPath == 0
58-
addpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions"))
59+
addpath(genpath(fullfile(testCase.RootFolder,"InstructorResources","Solutions")))
5960
end
6061

6162
% Close the StartUp app if still open:
@@ -73,7 +74,7 @@ function SetUpPath(testCase,Project)
7374
% Check that solutions files exist for each of the student
7475
% templates
7576
function ExistSolns(testCase,File)
76-
SolutionName = replace(string(File),".mlx","Soln.mlx");
77+
SolutionName = replace(string(File),".m","Soln.m");
7778
assert(exist(SolutionName,"file"),"Missing solutions for "+File);
7879
end
7980

@@ -82,7 +83,7 @@ function SmokeRun(testCase,File)
8283

8384
% Navigate to project root folder:
8485
cd(testCase.RootFolder)
85-
FileToRun = replace(string(File),".mlx","Soln.mlx");
86+
FileToRun = replace(string(File),".m","Soln.m");
8687

8788
% Pre-test:
8889
PreFiles = CheckPreFile(testCase,FileToRun);
@@ -132,7 +133,7 @@ function SmokeRun(testCase,File)
132133
methods (Access = private)
133134

134135
function Path = CheckPreFile(testCase,Filename)
135-
PreFile = "Pre"+replace(Filename,".mlx",".m");
136+
PreFile = "Pre"+extractBefore(Filename,".m")+".m";
136137
PreFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PreFiles",PreFile);
137138
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
138139
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PreFiles"))
@@ -148,7 +149,7 @@ function SmokeRun(testCase,File)
148149
end
149150

150151
function Path = CheckPostFile(testCase,Filename)
151-
PostFile = "Post"+replace(Filename,".mlx",".m");
152+
PostFile = "Post"+extractBefore(Filename,".m")+".m";
152153
PostFilePath = fullfile(testCase.RootFolder,"SoftwareTests","PostFiles",PostFile);
153154
if ~isfolder(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
154155
mkdir(fullfile(testCase.RootFolder,"SoftwareTests/PostFiles"))
@@ -163,4 +164,14 @@ function SmokeRun(testCase,File)
163164

164165
end % Private Access Methods
165166

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
176+
166177
end % SolnSmokeTests

0 commit comments

Comments
 (0)