diff --git a/.github/badges/tests.svg b/.github/badges/tests.svg
index 4dfcbc4d..69630578 100644
--- a/.github/badges/tests.svg
+++ b/.github/badges/tests.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml
index b0424f9f..ef9ae63f 100644
--- a/.github/workflows/update.yml
+++ b/.github/workflows/update.yml
@@ -1,11 +1,11 @@
-name: Update openMINDS_MATLAB
+name: Run tests
on:
# Triggers the workflow on push to any branch other than main or PR to main
# This way tests will run on any push to a feature branch and when feature
# branches are merged to main, but not repeated when PRs are actually merged.
push:
- branches-ignore: ["main", "pipeline", "gh-badges"]
+ branches-ignore: ["pipeline", "gh-badges"]
paths-ignore:
- '*README.md'
- '*md'
diff --git a/tools/tasks/testToolbox.m b/tools/tasks/testToolbox.m
index ec7bc07e..0e4fc018 100644
--- a/tools/tasks/testToolbox.m
+++ b/tools/tasks/testToolbox.m
@@ -9,9 +9,22 @@ function testToolbox(varargin)
% Use the openMINDS_MATLAB setup to download controlled instances
run( fullfile(projectRootDirectory, 'code', 'setup.m') )
+ codeFolder = fullfile(projectRootDirectory, "code");
+ codecoverageFileList = getCodeCoverageFileList(codeFolder); % local function
+
matbox.tasks.testToolbox(...
projectRootDirectory, ...
"CreateBadge", true, ...
+ "CoverageFileList", codecoverageFileList, ...
varargin{:} ...
)
end
+
+function fileList = getCodeCoverageFileList(codeFolder)
+ L = cat(1, ...
+ dir( fullfile(codeFolder, '+openminds', '**', '*.m') ), ...
+ dir( fullfile(codeFolder, 'internal', '**', '*.m') ), ...
+ dir( fullfile(codeFolder, 'schemas', 'latest', '**', '*.m') ));
+
+ fileList = fullfile(string({L.folder}'),string({L.name}'));
+end
\ No newline at end of file
diff --git a/tools/tests/unitTests/testInstanceSaveLoad.m b/tools/tests/unitTests/InstanceTest.m
similarity index 88%
rename from tools/tests/unitTests/testInstanceSaveLoad.m
rename to tools/tests/unitTests/InstanceTest.m
index fdc78720..099cfb7c 100644
--- a/tools/tests/unitTests/testInstanceSaveLoad.m
+++ b/tools/tests/unitTests/InstanceTest.m
@@ -1,5 +1,5 @@
-classdef testInstanceSaveLoad < matlab.unittest.TestCase
-% testInstanceSaveLoad Unit test for save and load operations on OpenMINDS types
+classdef InstanceTest < matlab.unittest.TestCase
+% InstanceTest - Unit test for creation and save/load of OpenMINDS instances
% Automatically generate a test case for each schema type
properties (TestParameter)
@@ -30,6 +30,15 @@ function testCreateSchema(testCase, SchemaType)
% Attempt to create an object of the schema class
instance = schemaFcn();
testCase.assertInstanceOf(instance, 'openminds.abstract.Schema')
+
+ testCase.verifyWarningFree( @(i)dispNoOutput(instance) )
+
+ strRep = string(instance);
+ testCase.verifyClass(strRep, 'string')
+
+ function dispNoOutput(instance) %#ok
+ c = evalc('disp(instance)'); %#ok
+ end
end
function testSaveLoadForSchema(testCase, SchemaType)