From bdaabc0428dbb28e4a0d6bd037ff2d4971238d33 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 27 Jul 2018 18:18:10 -0400 Subject: [PATCH] [Test/Matlab] Improve behavior when Matlab tests fail Outright failures of the Matlab test suite which result in the test log file not being written no longer cause SCons to abort. Instead, they are logged as a major test failure, similar to the behavior of the Python test suite. --- test/SConscript | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/SConscript b/test/SConscript index 036a89f09..e2eb63cb2 100644 --- a/test/SConscript +++ b/test/SConscript @@ -187,7 +187,13 @@ def addMatlabTest(script, testName, dependencies=None, env_vars=()): code = subprocess.call([pjoin(env['matlab_path'], 'bin', 'matlab')] + matlabOptions + ['-r', runCommand], env=environ, cwd=Dir('#test/matlab').abspath) - results = open(outfile).read() + try: + results = open(outfile).read() + except EnvironmentError: # TODO: replace with 'FileNotFoundError' after end of Python 2.7 support + testResults.failed['Matlab' + + ' ***no results for entire test suite***'] = 100 + return + print('-------- Matlab test results --------') print(results) print('------ end Matlab test results ------')