[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.
This commit is contained in:
Ray Speth 2018-07-27 18:18:10 -04:00
parent fd57936b18
commit bdaabc0428

View file

@ -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 ------')