Build out MATLAB test framework and core integration coverage
This commit is contained in:
26
Tests/IMDDTestCase.m
Normal file
26
Tests/IMDDTestCase.m
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
Reference in New Issue
Block a user