diff options
author | michelou <michelou@epfl.ch> | 2003-10-20 17:41:18 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-10-20 17:41:18 +0000 |
commit | d1a6514fb140a54ba445e985bef1ef9407427632 (patch) | |
tree | 386dcd10c01bf6041760d9c65530893255fcc5af | |
parent | 453e6a6db777da98cd5291f4f1c7fc7b70a7ba7f (diff) | |
download | scala-d1a6514fb140a54ba445e985bef1ef9407427632.tar.gz scala-d1a6514fb140a54ba445e985bef1ef9407427632.tar.bz2 scala-d1a6514fb140a54ba445e985bef1ef9407427632.zip |
- function 'execute' now returns exit value (wa...
- function 'execute' now returns exit value (was bool)
-rw-r--r-- | sources/scala/tools/scalatest/Command.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sources/scala/tools/scalatest/Command.java b/sources/scala/tools/scalatest/Command.java index be5fbb18c0..f254dc694c 100644 --- a/sources/scala/tools/scalatest/Command.java +++ b/sources/scala/tools/scalatest/Command.java @@ -67,8 +67,8 @@ public abstract class Command { } } - protected boolean execute(String cmdline, OutputStream out, OutputStream err) { - boolean ok = true; + protected int execute(String cmdline, OutputStream out, OutputStream err) { + int exitValue = -1; try { Process p = Runtime.getRuntime().exec(cmdline); StreamGobbler outputGobbler = new StreamGobbler(p.getInputStream(), out); @@ -80,8 +80,7 @@ public abstract class Command { // read any errors from the attempted command errorGobbler.start(); - int exitValue = p.waitFor(); - ok = exitValue >= 0; + exitValue = p.waitFor(); if (out != null) out.flush(); @@ -90,14 +89,14 @@ public abstract class Command { } catch (Exception e) { System.err.println(e.getMessage()); } - return ok; + return exitValue; } - protected boolean execute(String cmdline, OutputStream out) { - return execute(cmdline, out, null); + protected int execute(String cmdline, OutputStream out) { + return execute(cmdline, out, out); } - protected boolean execute(String cmdline) { + protected int execute(String cmdline) { return execute(cmdline, null, null); } |