, . , GITLAB type, , MATLAB , script .
, :
matlab -nodesktop -nosplash -minimize -wait -logfile log.txt -r 'disp(a); exit;'
, MATLAB exit.
, exit .
matlab -nodesktop -nosplash -minimize -wait -logfile log.txt -r 'disp(1); exit;'
, , . -, , try/catch, / .
runtests.m
% runtests.m
exit_code = 0;
try
Model
catch ME
disp(getReport(ME))
exit_code = 1;
end
% Ensure that we ALWAYS call exit
exit(exit_code);
bash script, MATLAB , MATLAB
LOGFILE=log.txt
matlab -nodesktop -nosplash -minimize -wait -logfile "$LOGFILE" -r 'runtests';
CODE=$?
cat "$LOGFILE"
exit $CODE
, , GITLAB CI .
.gitlab-ci.yml
test1:
script:
- "runtests.sh"