Skip to content

Commit

Permalink
added better cmdline option for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jlipps committed Sep 28, 2012
1 parent 21778a8 commit 6ffd2cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -12,8 +12,8 @@ Usage
-----
Install using composer. Then do this:

```vendor/bin/paraunit -p[PROCESSES] --PATH=TEST_PATH/TEST_GLOB
--PHPUNIT=PATH/TO/PHPUNIT```
```vendor/bin/paraunit (-pPROCESSES|--processes=PROCESSES) --path=TEST_PATH/TEST_GLOB
--phpunit=PATH/TO/PHPUNIT```

Todo
----
Expand Down
13 changes: 6 additions & 7 deletions bin/paraunit
Expand Up @@ -190,14 +190,16 @@ $PHPUNIT = dirname(__FILE__).'/../../../bin/phpunit';
function main($argv)
{
global $PHPUNIT;
$usage = "Usage: paraunit -p[NUM_PROCESSES] --path=TEST_PATH/TEST_GLOB --phpunit=PATH/TO/PHPUNIT\n";
$usage = "Usage: paraunit (-p[NUM_PROCESSES]|--processes=[NUM_PROCESSES]) --path=TEST_PATH/TEST_GLOB --phpunit=PATH/TO/PHPUNIT\n";
if (!isset($argv[1]) || !$argv[1])
die($usage);

$opts = getopt("p::", array('path:', 'phpunit::'));
$opts = getopt("p::", array('path:', 'phpunit::', 'processes::'));
if (!isset($opts['path']))
die($usage);
if (isset($opts['p']) && intval($opts['p']) > 0)
if (isset($opts['processes']) && intval($opts['processes']) > 0)
$processes = intval($opts['processes']);
elseif (isset($opts['p']) && intval($opts['p']) > 0)
$processes = intval($opts['p']);
else
$processes = 1;
Expand All @@ -211,10 +213,7 @@ function main($argv)
if ($PHPUNIT != 'phpunit' && !is_file($PHPUNIT))
die("Couldn't find phpunit at '$PHPUNIT'\n");

echo "Using phpunit at $PHPUNIT...\n";

//if ($opts['path'][0] != '/')
//$opts['path'] = getcwd().'/'.$opts['path'];
echo "Using phpunit in $processes process(es) with $PHPUNIT\n";

$files = getFiles($opts['path'], getcwd());

Expand Down

0 comments on commit 6ffd2cf

Please sign in to comment.