Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tutorial Tests #450

Merged
merged 12 commits into from
Jul 29, 2022
Merged
31 changes: 31 additions & 0 deletions +tests/+unit/tutorialTest.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function tests = tutorialTest()
tests = functiontests(localfunctions);
end

function setupOnce(testCase)
rootPath = fullfile(fileparts(mfilename('fullpath')), '..', '..');
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(rootPath));
tutorialPath = fullfile(rootPath, 'tutorials');
addpath(tutorialPath);
testCase.TestData.listing = dir(tutorialPath);
end

function setup(testCase)
testCase.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture);
generateCore('savedir', '.');
rehash();
end

function testTutorials(testCase)
skippedTutorials = {...
'basicUsage.mlx', ...
'convertTrials.m', ...
'formatStruct.m'};
for i = 1:length(testCase.TestData.listing)
listing = testCase.TestData.listing(i);
if listing.isdir || any(strcmp(skippedTutorials, listing.name))
continue;
end
run(listing.name);
end
end
Binary file modified tutorials/dynamically_loaded_filters.mlx
Binary file not shown.
Binary file modified tutorials/ecephys.mlx
Binary file not shown.
37 changes: 17 additions & 20 deletions tutorials/html/dynamically_loaded_filters.html

Large diffs are not rendered by default.

266 changes: 252 additions & 14 deletions tutorials/html/ecephys.html

Large diffs are not rendered by default.

206 changes: 0 additions & 206 deletions tutorials/ophys.m

This file was deleted.