about PHP_CodeSniffer 1.0.0 (regression test suite and more)
| From: | Laurent Laville | Date: | Sat, 22 Dec 2007 17:55:56 +0000 |
| Subject: | about PHP_CodeSniffer 1.0.0 (regression test suite and more) | ||
| Groups: | php.pear.qa | ||
| Request: | Send a blank email to pear-qa+get-4711@lists.php.net to get a copy of this message | ||
Hello Greg,
While I'm running in trouble with recent update of PHP_CodeSniffer (from 1.0.0RC3 to 1.0.0), I've run regression test suite in two way :
----------------------------------------------
Way 1:
------
pear run-tests -pu PHP_CodeSniffer
Results are :
Running 1 tests
TOTAL TIME: 00:03
1 PASSED TESTS
0 SKIPPED TESTS
But I've supected something wrong; because I don't see PHPUnit output.
For comparaison with HTML_CSS 1.4.0
pear run-tests -pu HTML_CSS
I got this kind of output
Running 1 tests
PHPUnit 3.2.4 by Sebastian Bergmann.
............................
Time: 0 seconds
OK (28 tests)
TOTAL TIME: 00:02
1 PASSED TESTS
0 SKIPPED TESTS
----------------------------------------------
Way 2:
phpunit PHP_CodeSniffer_ALLTests C:\wamp\php\PEAR\tests\PHP_CodeSnif
fer\AllTests.php
------
PHPUnit 3.2.4 by Sebastian Bergmann.
............................................................ 60 / 116
.....................................................S..
Time: 05:39
OK, but incomplete or skipped tests!
Tests: 116, Skipped: 1.
Solution :
Add on bottom of AllTests.php (rev 1.6)
********************
if (PHPUnit_MAIN_METHOD == 'PHP_CodeSniffer_AllTests::main') {
PHP_CodeSniffer_AllTests::main();} ******************** and way 1, will run pretty fine (except skipped test)! BTW I keep continue to investigate why I run in trouble with stable version 1.0.0 of phpcs Perharps you can help me ! From my local copy of CVS for HTML_CSS, I launch execution of process phpcs C:\php\pear\HTML_CSS\CSS.php and I got lot of warnings in php_error.log , something like [22-Dec-2007 18:49:01] PHP Stack trace: [22-Dec-2007 18:49:01] PHP 1. {main}() C:\wamp\php\phpcs:0 [22-Dec-2007 18:49:01] PHP 2. PHP_CodeSniffer->process($files = array (0 => 'c:\\php\\pear\\HTML_CSS\\CSS.php'), $standard = 'PEAR', $sniffs = array (), $local = FALSE) C:\wamp\php\phpcs:289 [22-Dec-2007 18:49:01] PHP 3. PHP_CodeSniffer->registerTokenListeners($standard = 'PEAR', $sniffs = array ()) C:\wamp\php\PEAR\PHP\CodeSniffer.php:254 [22-Dec-2007 18:49:01] PHP Warning: PHP_CodeSniffer::include_once(): Failed opening 'PEAR\PHP\CodeSniffer\Standards\Zend\Sniffs\Files\LineLengthSniff.php' for inclusion (include_path='C:\wamp\php\pear') in C:\wamp\php\PEAR\PHP\CodeSniffer.php on line 312 Last But not least HTML_CSS gave me 1387 errors while phpcs 1.0.0RC3 gave me 0 errors/0 warnings --- WARNING --- The Zend Code Analyzer path is not set. Run "phpcs --config-set zend_ca_path /path/to/ZendCodeAnalyzer". PHP CODE SNIFFER REPORT SUMMARY -------------------------------------------------------------------------------- FILE ERRORS -------------------------------------------------------------------------------- C:\php\pear\HTML_CSS\CSS.php 1387 -------------------------------------------------------------------------------- A TOTAL OF 1387 ERROR(S) WERE FOUND IN 1 FILE(S) -------------------------------------------------------------------------------- What's wrong ! Laurent