From 677efd82d57543577ba2455c59f2ab4e35cdad00 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 27 Jul 2018 18:43:19 -0400 Subject: [PATCH] [Test/Matlab] Collect pass/fail data for individual tests --- test/SConscript | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test/SConscript b/test/SConscript index e2eb63cb2..a145179e2 100644 --- a/test/SConscript +++ b/test/SConscript @@ -197,10 +197,26 @@ def addMatlabTest(script, testName, dependencies=None, env_vars=()): print('-------- Matlab test results --------') print(results) print('------ end Matlab test results ------') - if 'FAILED' in results: - testResults.failed[passedFile.name] = 1 - else: - testResults.passed[passedFile.name] = 1 + + passed = True + for line in results.split('\n'): + line = line.strip() + if not line: + continue + label = line.split()[0] + if 'seconds' not in line: # Headers for test suite sections + section = line + elif 'test' in line and 'matlab' in line: # skip overall summary line + continue + elif label == section: # skip summary line for each section + continue + elif 'FAILED' in line: + testResults.failed['.'.join(['Matlab', section, label])] = 1 + passed = False + elif 'passed' in line: + testResults.passed['.'.join(['Matlab', section, label])] = 1 + + if passed: open(target[0].path, 'w').write(time.asctime()+'\n') testenv = localenv.Clone()