Jenkins on Windows - Matlab Doesn't Exit

Viewed 508

The following command on Jenkins freestyle doesn't exit(runs forever) in Windows environment. However when I run the same command in CMD it works as expected.

matlab -nodesktop -nosplash -minimize -c "path_to_license" -r "run('path_to_run_all_tests_script')" -wait -logfile unittestlog.txt set output=%errorlevel% MORE unittestlog.txt EXIT %output%

What am I doing wrong?

EDIT:

This is the Matlab script that the command calls:

import matlab.unittest.TestSuite;

disp('Hello from TestSuite');
try
    suite = TestSuite.fromPackage('test','IncludingSubpackages',true);
    results = run(suite);
    display(results);
catch e
    disp(getReport(e,'extended'));
    exit(1);
end
exit(any([results.Failed])+1);
2 Answers
Related