com pftt2: fix exception running `pftt` (no console options): src/com/mostc/pftt/main/PfttMain.java

From: Date: Thu, 06 Jun 2013 20:14:06 +0000
Subject: com pftt2: fix exception running `pftt` (no console options): src/com/mostc/pftt/main/PfttMain.java
Groups: php.qa 
Request: Send a blank email to php-qa+get-67170@lists.php.net to get a copy of this message
Commit: a9d0cae93e450c634d94df985ab454ee23662ec4 Author: Matt Ficken <v-mafick@microsoft.com> Thu, 6 Jun 2013 13:14:06 -0700 Parents: 53a8e5cf82d56b58f72a3e93801b2c8c2aee5175 Branches: master Link: http://git.php.net/?p=pftt2.git;a=commitdiff;h=a9d0cae93e450c634d94df985ab454ee23662ec4 Log: fix exception running pftt (no console options) Changed paths: M src/com/mostc/pftt/main/PfttMain.java Diff: diff --git a/src/com/mostc/pftt/main/PfttMain.java b/src/com/mostc/pftt/main/PfttMain.java index 006a11b..bde85ed 100644 --- a/src/com/mostc/pftt/main/PfttMain.java +++ b/src/com/mostc/pftt/main/PfttMain.java @@ -78,6 +78,7 @@ import com.mostc.pftt.util.WindowsSnapshotDownloadUtil.FindBuildTestPackPair; // the php test tool that you'd actually want to use // doesn't resort to brittle shell scripts +// TODO wordpress-tests changes to make it work with pftt // TODO valgrind // TODO linux installer @@ -1095,7 +1096,7 @@ public class PfttMain { public static void main(String[] args) throws Throwable { // - if (args[0].equals("sleep")) { + if (args.length > 0 && args[0].equals("sleep")) { // special help for sleep.cmd // @see bin\sleep.cmd int seconds = Integer.parseInt(args[1]); @@ -1149,12 +1150,14 @@ public class PfttMain { } // have config files process console args (add to them, remove, etc...) - List<String> args_list = ArrayUtil.toList(args); - if (config.processConsoleOptions(cm, args_list)) { - // config file(s) changed console options. show the console options PFTT will now be run with. - System.out.println("PFTT: Console Options: "+args_list); + if (args.length > 0) { + List<String> args_list = ArrayUtil.toList(args); + if (config.processConsoleOptions(cm, args_list)) { + // config file(s) changed console options. show the console options PFTT will now be run with. + System.out.println("PFTT: Console Options: "+args_list); + } + args = ArrayUtil.toArray(args_list); } - args = ArrayUtil.toArray(args_list); // // process all console args now

« previous php.qa (#67170) next »