1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

Add verbose mode to command line test runner.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2008-11-23 20:45:21 -05:00
parent 778ddf7c96
commit 527f154d3d
2 changed files with 23 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
<?php
class HTMLPurifier_SimpleTest_TextReporter extends TextReporter {
protected $verbose = false;
function __construct($AC) {
$this->verbose = $AC['verbose'];
}
function paintPass($message) {
parent::paintPass($message);
if ($this->verbose) {
print 'Pass ' . $this->getPassCount() . ") $message\n";
$breadcrumb = $this->getTestList();
array_shift($breadcrumb);
print "\tin " . implode("\n\tin ", array_reverse($breadcrumb));
print "\n";
}
}
}

View File

@@ -40,6 +40,7 @@ $AC['xml'] = false;
$AC['dry'] = false;
$AC['php'] = $php;
$AC['help'] = false;
$AC['verbose'] = false;
$AC['type'] = '';
$AC['disable-phpt'] = false;
@@ -47,7 +48,8 @@ $AC['only-phpt'] = false; // alias for --type=phpt
$aliases = array(
'f' => 'file',
'h' => 'help'
'h' => 'help',
'v' => 'verbose',
);
// It's important that this does not call the autoloader. Not a problem
@@ -65,6 +67,7 @@ Allowed options:
--php /path/to/php
--type ( htmlpurifier | configdoc | fstools | htmlt | vtest | phpt )
--disable-phpt
--verbose (-v)
<?php
exit;
}
@@ -88,7 +91,7 @@ if ($AC['xml']) {
if (!SimpleReporter::inCli()) header('Content-Type: text/xml;charset=UTF-8');
$reporter = new XmlReporter();
} elseif (SimpleReporter::inCli()) {
$reporter = new TextReporter();
$reporter = new HTMLPurifier_SimpleTest_TextReporter($AC);
} else {
$reporter = new HTMLPurifier_SimpleTest_Reporter('UTF-8', $AC);
}