Skip to content

Commit 2c9e59d

Browse files
authored
Merge pull request #53 from mathworks/sdfix
Sdfix
2 parents 8146c21 + 2d987f8 commit 2c9e59d

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.circleci/test-deploy.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ executors:
2323
image: ubuntu-2204:2022.07.1
2424
macos:
2525
macos:
26-
xcode: 13.4.1
26+
xcode: 15.1.0
2727
windows:
2828
win/default
2929

@@ -40,14 +40,15 @@ jobs:
4040
name: Verify the matlab and mex scripts are available
4141
command: |
4242
set -e
43-
matlab -batch version
4443
os=$(uname)
4544
if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
4645
mex.bat -h
4746
else
4847
mex -h
4948
fi
5049
shell: bash
50+
- matlab/run-command:
51+
command: version
5152

5253
integration-test-install-release:
5354
parameters:
@@ -57,13 +58,9 @@ jobs:
5758
steps:
5859
- checkout
5960
- matlab/install:
60-
release: R2021a
61-
- run:
62-
name: Verify the matlab and mex scripts are available
63-
command: |
64-
set -e
65-
matlab -batch "assert(strcmp(version('-release'),'2021a'))"
66-
shell: bash
61+
release: "R2021b"
62+
- matlab/run-command:
63+
command: assert(strcmp(version('-release'),'2021b'))
6764

6865
integration-test-run-command:
6966
parameters:
@@ -107,6 +104,14 @@ jobs:
107104
startup-options: -logfile mylog.log
108105
- matlab/run-command:
109106
command: assert(isfile("mylog.log"), 'logfile was not created as expected')
107+
- run:
108+
command: |
109+
mkdir subdir
110+
echo 'onetyone = 11' > subdir/startup.m
111+
shell: bash
112+
- matlab/run-command:
113+
command: assert(onetyone==11, 'onetyone was not set as expected by subdir/startup.m')
114+
startup-options: -sd subdir
110115

111116
integration-test-run-tests:
112117
parameters:

src/scripts/run-build.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v1/i
1515

1616
# form OS appropriate paths for MATLAB
1717
os=$(uname)
18-
workdir=$(pwd)
1918
scriptdir=$tmpdir
2019
binext=""
2120
if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
22-
workdir=$(cygpath -w "$workdir")
2321
scriptdir=$(cygpath -w "$scriptdir")
2422
binext=".exe"
2523
fi
@@ -30,10 +28,10 @@ buildCommand="buildtool ${PARAM_TASKS}"
3028
# create script to execute
3129
script=command_${RANDOM}
3230
scriptpath=${tmpdir}/${script}.m
33-
echo "cd('${workdir//\'/\'\'}');" > "$scriptpath"
31+
echo "cd(getenv('MW_ORIG_WORKING_FOLDER'));" > "$scriptpath"
3432
cat << EOF >> "$scriptpath"
3533
$buildCommand
3634
EOF
3735

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

src/scripts/run-command.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,20 @@ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v1/i
1515

1616
# form OS appropriate paths for MATLAB
1717
os=$(uname)
18-
workdir=$(pwd)
1918
scriptdir=$tmpdir
2019
binext=""
2120
if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
22-
workdir=$(cygpath -w "$workdir")
2321
scriptdir=$(cygpath -w "$scriptdir")
2422
binext=".exe"
2523
fi
2624

2725
# create script to execute
2826
script=command_${RANDOM}
2927
scriptpath=${tmpdir}/${script}.m
30-
echo "cd('${workdir//\'/\'\'}');" > "$scriptpath"
28+
echo "cd(getenv('MW_ORIG_WORKING_FOLDER'));" > "$scriptpath"
3129
cat << EOF >> "$scriptpath"
3230
${PARAM_COMMAND}
3331
EOF
3432

3533
# run MATLAB command
36-
"${tmpdir}/bin/run-matlab-command$binext" "cd('${scriptdir//\'/\'\'}');$script" $PARAM_ARGS
34+
"${tmpdir}/bin/run-matlab-command$binext" "setenv('MW_ORIG_WORKING_FOLDER', cd('${scriptdir//\'/\'\'}'));$script" $PARAM_ARGS

0 commit comments

Comments
 (0)