Skip to content

Commit 2533f5a

Browse files
committed
Initial startup-options support
1 parent 4eaf5f7 commit 2533f5a

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

.circleci/test-deploy.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ jobs:
151151
- matlab/run-tests:
152152
test-results-junit: test-results/matlab/filterdtagresult.xml
153153
select-by-tag: FILTERED
154+
- matlab/run-tests:
155+
startup-options: -logfile console.log
154156

155157
- run:
156158
name: Verify test results file was created
@@ -192,6 +194,16 @@ jobs:
192194
grep -v simpleTest test-results/matlab/filterdtagresult.xml
193195
shell: bash
194196

197+
- run:
198+
name: Verify tests ran with startup options
199+
command: |
200+
set -e
201+
grep StartupTest console.log
202+
grep FirstTest console.log
203+
grep simpleTest console.log
204+
rm console.log
205+
shell: bash
206+
195207
- run:
196208
name: Set up diary for logging
197209
command: |

src/commands/run-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ parameters:
1010
in the plan returned by buildfile.m as well as all the tasks on which they depend.
1111
type: string
1212
default: ""
13+
startup-options:
14+
description: >
15+
MATLAB startup options. If you specify more than one option, use a space to
16+
separate the options.
17+
type: string
18+
default: ""
1319
no-output-timeout:
1420
description: >
1521
Elapsed time the command can run without output. The string is a decimal with unit suffix,
@@ -23,6 +29,7 @@ steps:
2329
name: Run MATLAB build
2430
environment:
2531
PARAM_TASKS: <<parameters.tasks>>
32+
PARAM_ARGS: <<parameters.startup-options>>
2633
command: <<include(scripts/run-build.sh)>>
2734
shell: bash
2835
no_output_timeout: <<parameters.no-output-timeout>>

src/commands/run-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ parameters:
9696
Maximum verbosity level for logged diagnostics included for the test run, specified as 'None', 'Terse', 'Concise', 'Detailed', or 'Verbose'.
9797
type: string
9898
default: ''
99+
startup-options:
100+
description: >
101+
MATLAB startup options. If you specify more than one option, use a space to
102+
separate the options.
103+
type: string
104+
default: ""
99105

100106
steps:
101107
- run:
@@ -116,6 +122,7 @@ steps:
116122
PARAM_USE_PARALLEL: <<parameters.use-parallel>>
117123
PARAM_OUTPUT_DETAIL: <<parameters.output-detail>>
118124
PARAM_LOGGING_LEVEL: <<parameters.logging-level>>
125+
PARAM_ARGS: <<parameters.startup-options>>
119126
command: <<include(scripts/run-tests.sh)>>
120127
shell: bash
121128
no_output_timeout: <<parameters.no-output-timeout>>

src/scripts/run-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ $buildCommand
3636
EOF
3737

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

src/scripts/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ fi
4747
disp('Running MATLAB script with contents:');\
4848
disp(testScript.Contents);\
4949
fprintf('__________\n\n');\
50-
run(testScript);"
50+
run(testScript);" $PARAM_ARGS

0 commit comments

Comments
 (0)