27 lines
863 B
Matlab
27 lines
863 B
Matlab
classdef (Abstract) IMDDTestCase < matlab.unittest.TestCase
|
|
% Base class for repository tests.
|
|
% Ensures the relevant project folders are on the MATLAB path so tests
|
|
% can run both from the Test Browser and from the custom entrypoint.
|
|
|
|
methods (TestClassSetup)
|
|
function addRepositoryPaths(~)
|
|
root = IMDDTestCase.repoRoot();
|
|
addpath(root);
|
|
|
|
folders = ["Classes", "Functions", "Datatypes", "Libs", "Tests"];
|
|
for folder = folders
|
|
fullFolder = fullfile(root, folder);
|
|
if isfolder(fullFolder)
|
|
addpath(genpath(fullFolder));
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
methods (Static, Access = protected)
|
|
function root = repoRoot()
|
|
root = fileparts(fileparts(mfilename("fullpath")));
|
|
end
|
|
end
|
|
end
|