Skip to content

Commit

Permalink
more < R2020b test skip
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Oct 16, 2020
1 parent 8c050f9 commit c5b4a61
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
5 changes: 3 additions & 2 deletions +gemini3d/+tests/TestAUnit.m
Expand Up @@ -63,9 +63,10 @@ function test_with_suffix(tc)
if ~verLessThan("matlab", "9.9")
% fileparts vectorized in R2020b
tc.verifyEqual(gemini3d.fileio.with_suffix(["foo.h5", "bar.dat"], ".nc"), ["foo.nc", "bar.nc"])
end

tc.verifyEmpty(gemini3d.fileio.with_suffix(string.empty, ".nc"))
end
end

function test_path_tail(tc)
tc.verifyEqual(gemini3d.fileio.path_tail("a/b/c.h5"), "c.h5")
Expand All @@ -75,10 +76,10 @@ function test_path_tail(tc)
if ~verLessThan("matlab", "9.9")
% fileparts vectorized in R2020b
tc.verifyEqual(gemini3d.fileio.path_tail(["c.h5", "a/b/c/"]), ["c.h5", "c"])
end

tc.verifyEmpty(gemini3d.fileio.path_tail(string.empty))
end
end


function test_dateinc(tc)
Expand Down
20 changes: 18 additions & 2 deletions test_gemini.m
@@ -1,17 +1,33 @@
import matlab.unittest.TestSuite
import matlab.unittest.TestRunner
import matlab.unittest.plugins.LoggingPlugin
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.codecoverage.CoberturaFormat

runner = TestRunner.withTextOutput;
p = LoggingPlugin.withVerbosity(matlab.unittest.Verbosity.Detailed,...
'HideLevel',true,'HideTimestamp',true, 'Description', "");
runner.addPlugin(p);

isCI = getenv("CI") == "true";

% coverage
if isCI
% future
reportFile = 'CoverageResults.xml';
reportFormat = CoberturaFormat(reportFile);
% plugin = CodeCoveragePlugin.forPackage('gemini3d','Producing',reportFormat);
% runner.addPlugin(plugin);
else
% works, but saving time
% runner.addPlugin(CodeCoveragePlugin.forPackage('gemini3d'))
end

suite = TestSuite.fromPackage('gemini3d.tests');

% under future consideration--need to manually start parallel pool for CI
% need to manually start parallel pool for CI
addons = matlab.addons.installedAddons();
if (getenv("CI") ~= "true") && any(contains(addons.Name, 'Parallel Computing Toolbox'))
if ~isCI && any(contains(addons.Name, 'Parallel Computing Toolbox'))
results = runInParallel(runner, suite);
else
results = runner.run(suite);
Expand Down

0 comments on commit c5b4a61

Please sign in to comment.