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

Commit 98dab55

Browse files
authored
Update MatlabBuilderConstants.java
1 parent d911a3d commit 98dab55

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
package com.mathworks.ci;
2-
3-
/*
1+
package com.mathworks.ci;
2+
/*
43
* Copyright 2019-2020 The MathWorks, Inc.
54
*/
65

@@ -38,22 +37,22 @@ public class MatlabBuilderConstants {
3837
//Temporary MATLAB folder name in workspace
3938
static final String TEMP_MATLAB_FOLDER_NAME = ".matlab";
4039

40+
static final String NEW_LINE = System.getProperty("line.separator");
41+
42+
static final String TEST_RUNNER_SCRIPT = String.join(NEW_LINE,
43+
"tmpDir=tempname;",
44+
"mkdir(tmpDir);",
45+
"addpath(tmpDir);",
46+
"zipURL='${ZIP_FILE}';",
47+
"unzip(zipURL,tmpDir);",
48+
"testScript = genscript(${PARAMS});",
49+
"disp('Running MATLAB script with content:');",
50+
"disp(testScript.Contents);",
51+
"testScript.writeToFile(fullfile(tmpDir,'runnerScript.m'));",
52+
"fprintf('___________________________________\\n\\n');");
53+
}
4154

42-
43-
static final String TEST_RUNNER_SCRIPT="destination=tempname;\n"
44-
+"mkdir(destination);\n"
45-
+ "addpath(destination);\n"
46-
+"zipURL='${ZIP_FILE}';\n"
47-
+"unzip(zipURL,destination);\n"
48-
+"disp('Unziping genscript resource in');\n"
49-
+"disp(destination);\n"
50-
+ "testScript = genscript(${PARAMS});\n"
51-
+ "disp('Running MATLAB script with content:');\n"
52-
+ "disp(strtrim(testScript.Contents));\n"
53-
+ "runnerFile = testScript.writeToFile(fullfile(destination,'runnerScript.m'));\n"
54-
+"warning('off');"
55-
+ "fprintf('___________________________________\\n\\n');\n";
5655

5756

58-
}
57+
5958

0 commit comments

Comments
 (0)