Files
imdd_silas/Tests/IMDDTestCase.m
2026-03-24 17:23:02 +01:00

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