com phpruntests: updated commandline-options and testcase: src/configuration/rtCommandLineOptions.php src/texts/help.txt
tests/configuration/rtCommandLineOptionsTest.php

From: Date: Thu, 03 Sep 2009 18:40:09 +0000
Subject: com phpruntests: updated commandline-options and testcase: src/configuration/rtCommandLineOptions.php src/texts/help.txt
tests/configuration/rtCommandLineOptionsTest.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66294@lists.php.net to get a copy of this message
Commit: 100f6c365275f25bfd2b6aac6d9a0348d0716dcd Author: Georg Gradwohl <g2@php.net> Thu, 3 Sep 2009 18:40:09 +0000 Parents: 81757c58f338fe700a20126e32bb7984080eef20 Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=100f6c365275f25bfd2b6aac6d9a0348d0716dcd Log: updated commandline-options and testcase Changed paths: M src/configuration/rtCommandLineOptions.php M src/texts/help.txt M tests/configuration/rtCommandLineOptionsTest.php Diff: diff --git a/src/configuration/rtCommandLineOptions.php b/src/configuration/rtCommandLineOptions.php index 81c270b..58188eb 100644 --- a/src/configuration/rtCommandLineOptions.php +++ b/src/configuration/rtCommandLineOptions.php @@ -30,6 +30,8 @@ class rtCommandLineOptions * @var array */ protected $shortOptionsWithArgs = array( + 'l', // read the testfiles to be executed from + 'r', // read the testfiles to be executed from 'c', // look for php.ini 'd', // pass option to the php binary 'p', // specify php executable diff --git a/src/texts/help.txt b/src/texts/help.txt index e5bf571..25df4bc 100644 --- a/src/texts/help.txt +++ b/src/texts/help.txt @@ -1,4 +1,3 @@ - Synopsis: php run-tests.php [options] [files] [directories] @@ -24,6 +23,13 @@ Options: -o <list|csv|xml> Output format (default=list) -s <file> Write output to <file> + + -l <file> Read the testfiles to be executed from <file>. After the test + has finished all failed tests are written to the same <file>. + If the list is empty and no further test is specified then + all tests are executed (same as: -r <file> -w <file>). + + -r <file> Read the testfiles to be executed from <file>. -v verbose-mode level 1 basic information, test-name and status diff --git a/tests/configuration/rtCommandLineOptionsTest.php b/tests/configuration/rtCommandLineOptionsTest.php index 854b152..388de08 100644 --- a/tests/configuration/rtCommandLineOptionsTest.php +++ b/tests/configuration/rtCommandLineOptionsTest.php @@ -33,19 +33,19 @@ class rtCommandLineOptionsTest extends PHPUnit_Framework_TestCase public function testShortOptionWithArg() { $clo = new rtCommandLineOptions(); - $clo->parse(array('run-tests.php', '-l', 'the-l-arg')); + $clo->parse(array('run-tests.php', '-d', 'the-d-arg')); - $this->assertTrue($clo->hasOption('l')); - $this->assertEquals('the-l-arg', $clo->getOption('l')); + $this->assertTrue($clo->hasOption('d')); + $this->assertEquals('the-d-arg', $clo->getOption('d')); } public function testLongOptionWithArg() { $clo = new rtCommandLineOptions(); - $clo->parse(array('run-tests.php', '--html', 'the-html-arg')); + $clo->parse(array('run-tests.php', '--keep-all', 'the-keepall-arg')); - $this->assertTrue($clo->hasOption('html')); - $this->assertEquals('the-html-arg', $clo->getOption('html')); + $this->assertTrue($clo->hasOption('keep-all')); + $this->assertEquals('the-keepall-arg', $clo->getOption('keep-all')); } public function testNonexistingOption() @@ -63,8 +63,8 @@ class rtCommandLineOptionsTest extends PHPUnit_Framework_TestCase public function testMissingShortOptionArgument() { $clo = new rtCommandLineOptions(); - $clo->parse(array('run-tests.php', '-l')); - $clo->getOption('l'); + $clo->parse(array('run-tests.php', '-d')); + $clo->getOption('d'); } /** @@ -73,8 +73,8 @@ class rtCommandLineOptionsTest extends PHPUnit_Framework_TestCase public function testMissingLongOptionArgument() { $clo = new rtCommandLineOptions(); - $clo->parse(array('run-tests.php', '--html')); - $clo->getOption('html'); + $clo->parse(array('run-tests.php', '--mopts')); + $clo->getOption('--mopts'); } public function testFileArgument()

« previous php.qa (#66294) next »