From d14bceaa1acadf8ed9dca783421662ae36bcef5d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 5 Mar 2007 23:30:25 +0100 Subject: added JsStrip unit test files This patch adds unit test files from the new release of JsStrip [1]. Some of the tests currently fail pointing to bugs which are fixed in the new JsStrip release. The fixes need to be ported to DokuWiki's js_compress function. This patch also adds a way to output additional info when a test fails. It misuses SimpleTest's signalling which is probably a bad idea but works for now. http://code.google.com/p/jsstrip/ darcs-hash:20070305223025-7ad00-583a70a1ddc374eb61193f9315af99baeedea0be.gz --- _test/lib/cli_reporter.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to '_test/lib') diff --git a/_test/lib/cli_reporter.php b/_test/lib/cli_reporter.php index a65112a34..e83911c73 100644 --- a/_test/lib/cli_reporter.php +++ b/_test/lib/cli_reporter.php @@ -23,6 +23,7 @@ if (version_compare(phpversion(), '4.3.0', '<') || class CLIReporter extends SimpleReporter { var $faildetail_separator = ST_FAILDETAIL_SEPARATOR; + var $_failinfo; function CLIReporter($faildetail_separator = NULL) { $this->SimpleReporter(); @@ -54,6 +55,10 @@ class CLIReporter extends SimpleReporter { parent::paintFail($message); fwrite(STDERR, 'FAIL' . $this->faildetail_separator . $this->_paintTestFailDetail($message)); + if($this->_failinfo){ + fwrite(STDERR, ' additional info was: '.$this->_failinfo."\n"); + $this->_failinfo = ''; + } } /** @@ -65,6 +70,16 @@ class CLIReporter extends SimpleReporter { $this->_paintTestFailDetail($message)); } + /** + * Handle failinfo message + */ + function paintSignal($type,$message) { + parent::paintSignal($type,$message); + if($type = 'failinfo') $this->_failinfo = $message; + } + + + /** * Paint a footer with test case name, timestamp, counts of fails and * exceptions. -- cgit v1.2.3