Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit e46f207

Browse files
authored
Update RunMatlabTestsBuilder.java
1 parent 8619184 commit e46f207

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/com/mathworks/ci/RunMatlabTestsBuilder.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
*/
1010

1111
import java.io.IOException;
12-
import java.nio.file.Files;
13-
import java.nio.file.Path;
1412
import java.util.Map;
1513
import java.util.HashMap;
1614
import java.util.List;
@@ -264,7 +262,7 @@ public void perform(@Nonnull Run<?, ?> build, @Nonnull FilePath workspace,
264262
}
265263
}
266264

267-
private int execMatlabCommand(FilePath workspace, Launcher launcher,/////change needs to be made here.
265+
private int execMatlabCommand(FilePath workspace, Launcher launcher,
268266
TaskListener listener, EnvVars envVars) throws IOException, InterruptedException {
269267

270268
/*
@@ -275,17 +273,14 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,/////change
275273

276274
final String uniqueTmpFldrName = getUniqueNameForRunnerFile();
277275
ProcStarter matlabLauncher;
278-
279276
try {
280-
281-
FilePath genScriptLocation =
277+
FilePath genScriptLocation =
282278
getFilePathForUniqueFolder(launcher, uniqueTmpFldrName, workspace);
283279

284280
matlabLauncher = getProcessToRunMatlabCommand(workspace, launcher, listener, envVars,
285281
constructCommandForTest(genScriptLocation), uniqueTmpFldrName);
286282

287283
// copy genscript package in temp folder and write a runner script.
288-
289284
prepareTmpFldr(genScriptLocation, getRunnerScript(
290285
MatlabBuilderConstants.TEST_RUNNER_SCRIPT, envVars.expand(getInputArguments()),uniqueTmpFldrName));
291286

@@ -305,10 +300,9 @@ private int execMatlabCommand(FilePath workspace, Launcher launcher,/////change
305300

306301
public String constructCommandForTest(FilePath scriptPath) {
307302
final String matlabScriptName = getValidMatlabFileName(scriptPath.getBaseName());
308-
309303
final String runCommand = "addpath('" + scriptPath.getRemote().replaceAll("'", "''")
310304
+ "'); " + matlabScriptName + ",delete('.matlab/" + scriptPath.getBaseName() + "/"
311-
+ matlabScriptName + ".m'),runnerScript,rmdir(destination,'s')";
305+
+ matlabScriptName + ".m'),runnerScript,rmdir(tmpDir,'s')";
312306
return runCommand;
313307
}
314308

0 commit comments

Comments
 (0)