3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
22 use Wikimedia\Parsoid\ParserTests\Test
as ParserTest
;
23 use Wikimedia\Parsoid\ParserTests\TestMode
as ParserTestMode
;
26 * Interface to record parser test results.
28 * The TestRecorder is a class hierarchy to record the result of
29 * MediaWiki parser tests. One should call start() before running the
30 * full parser tests and end() once all the tests have been finished.
31 * After each test, you should use record() to keep track of your tests
32 * results. Finally, report() is used to generate a summary of your
33 * test run, one could dump it to the console for human consumption or
34 * register the result in a database for tracking purposes.
41 * Called at beginning of the parser test run
43 public function start() {
47 * Called before starting a test
48 * @param ParserTest $test
49 * @param ParserTestMode $mode
51 public function startTest( ParserTest
$test, ParserTestMode
$mode ) {
55 * Called before starting an input file
58 public function startSuite( string $path ) {
62 * Called after ending an input file
65 public function endSuite( string $path ) {
69 * Called after each test
70 * @param ParserTestResult $result
72 public function record( ParserTestResult
$result ) {
76 * Show a warning to the user
77 * @param string $message
79 public function warning( string $message ) {
84 * @param ParserTest $test
85 * @param ParserTestMode $mode
86 * @param string $reason
88 public function skipped( ParserTest
$test, ParserTestMode
$mode, string $reason ) {
92 * Called before finishing the test run
94 public function report() {
98 * Called at the end of the parser test run
100 public function end() {