MCPcopy
hub / github.com/arduino/Arduino / runArduino

Method runArduino

app/test/processing/app/CommandLineTest.java:85–104  ·  view source on GitHub ↗
(boolean output, boolean success, File wd, String[] extraArgs)

Source from the content-addressed store, hash-verified

83 }
84
85 public Process runArduino(boolean output, boolean success, File wd, String[] extraArgs) throws IOException, InterruptedException {
86 Runtime rt = Runtime.getRuntime();
87
88 List<String> args = new ArrayList<String>();
89 args.add(arduinoPath.getAbsolutePath());
90 args.addAll(Arrays.asList(getBaseArgs()));
91 args.addAll(Arrays.asList(extraArgs));
92
93 System.out.println("Running: " + String.join(" ", args));
94
95 Process pr = rt.exec(args.toArray(new String[0]), null, wd);
96 if (output) {
97 IOUtils.copy(pr.getInputStream(), System.out);
98 IOUtils.copy(pr.getErrorStream(), System.out);
99 }
100 pr.waitFor();
101 if (success)
102 assertEquals(0, pr.exitValue());
103 return pr;
104 }
105
106 @Test
107 public void testCommandLineBuildWithRelativePath() throws Exception {

Calls 7

getBaseArgsMethod · 0.80
getInputStreamMethod · 0.80
waitForMethod · 0.80
addMethod · 0.45
joinMethod · 0.45
execMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected