From df3491e3dd7e70606447ce399fe307f7210dd484 Mon Sep 17 00:00:00 2001
From: Federico Felici <federico.felici@epfl.ch>
Date: Thu, 30 Sep 2021 16:10:30 +0200
Subject: [PATCH] further update of run_gdat_tests for good cov name

---
 matlab/run_gdat_tests.m | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/matlab/run_gdat_tests.m b/matlab/run_gdat_tests.m
index b47c4dea..0d60c7e0 100644
--- a/matlab/run_gdat_tests.m
+++ b/matlab/run_gdat_tests.m
@@ -43,6 +43,9 @@ elseif numel(setpathsfile)>1
   error('multiple setpaths_* files found!');
 end
 
+%% Name
+tbxname = 'gdat';
+
 %% Generate test suite
 testspath = fullfile(tbxpath,'tests');
 
@@ -84,9 +87,15 @@ end
 %% run it
 fprintf('Start test case: %s\n%s\n\n',test_case,datestr(now));
 runner = matlab.unittest.TestRunner.withTextOutput;
+
+%% Reports
+if needXML || needCOV
+  prefix = sprintf('test_%s',tbxname);
+  suffix = version('-release');
+end
 if needXML
   % Add some JUnit XML file with tests results
-  xmlFile = fullfile(projectpath,sprintf('test_%s_%s.xml',test_case,version('-release')));
+  xmlFile = fullfile(projectpath,sprintf('%s_%s_%s.xml',prefix,test_case,suffix));
   fprintf('\tGenerating JUnit XML report at %s\n',xmlFile);
   p = XMLPlugin.producingJUnitFormat(xmlFile);
   runner.addPlugin(p)
@@ -96,11 +105,11 @@ if needCOV
   switch lower(test_case)
     case 'coverage'
       % Produce HTML report
-      reportFolder = fullfile(projectpath,sprintf('test_%s_cov',version('-release')));
+      reportFolder = fullfile(projectpath,sprintf('%s_%s_cov',prefix,suffix));
       reportFormat = matlab.unittest.plugins.codecoverage.CoverageReport(reportFolder);
     otherwise
       % Produce XML file in Cobertura format (for Gitlab MR viz.)
-      xmlFile = fullfile(projectpath,sprintf('test_%s_%s_cov.xml',test_case,version('-release')));
+      xmlFile = fullfile(projectpath,sprintf('%s_%s_%s_cov.xml',prefix,test_case,suffix));
       reportFormat = matlab.unittest.plugins.codecoverage.CoberturaFormat(xmlFile);
   end
   p = matlab.unittest.plugins.CodeCoveragePlugin.forFolder(fileparts(mfilename('fullpath')),...
-- 
GitLab