Skip to content
26 changes: 16 additions & 10 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ jobs:
shell: bash
- matlab/run-command:
command: assert(myvar==123, 'myvar was not set as expected by startup.m')
- matlab/run-command:
command: disp("Hello world!")
startup-options: -logfile mylog.log
- matlab/run-command:
command: assert(isfile("mylog.log"), 'logfile was not created as expected')

integration-test-run-tests:
parameters:
Expand Down Expand Up @@ -202,16 +207,17 @@ jobs:
grep -q "runner.addPlugin(FailOnWarningsPlugin())" console.log
rm console.log
shell: bash
- matlab/run-tests:
use-parallel: true
source-folder: src
- run:
name: Verify tests ran in parallel
command: |
set -e
grep -q "parallel pool" console.log
rm console.log
shell: bash
# Running test in parallel is currently unsupported
# - matlab/run-tests:
# use-parallel: true
# source-folder: src
# - run:
# name: Verify tests ran in parallel
# command: |
# set -e
# grep -q "parallel pool" console.log
# rm console.log
# shell: bash
- matlab/run-tests:
output-detail: Detailed
source-folder: src
Expand Down
7 changes: 7 additions & 0 deletions src/commands/run-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ parameters:
script or function, do not specify the file extension. If you specify more than one MATLAB
command, use a comma or semicolon to separate the commands.
type: string
startup-options:
description: >
MATLAB startup options. If you specify more than one option, use a space to
separate the options.
type: string
default: ""
no-output-timeout:
description: >
Elapsed time the command can run without output. The string is a decimal with unit suffix,
Expand All @@ -25,6 +31,7 @@ steps:
name: Run MATLAB command
environment:
PARAM_COMMAND: <<parameters.command>>
PARAM_ARGS: <<parameters.startup-options>>
command: <<include(scripts/run-command.sh)>>
shell: bash
no_output_timeout: <<parameters.no-output-timeout>>
2 changes: 1 addition & 1 deletion src/scripts/run-command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ ${PARAM_COMMAND}
EOF

# run MATLAB command
"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script"
"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS