Allow parsoid-compatible parser tests to select a subset of parsoid modes
This lets you tag a parser test file with: !! options parsoid-compatible=wt2html !! end to indicate that you want to run only the parsoid wt2html tests on this file. This is especially useful when gradually adding integrated-mode parsoid output clauses to an existing test file. Change-Id: Id870d23da3c127fea61d6b8ab98200c0e4c661e2
This commit is contained in:
parent
694982e62b
commit
02d13afa7e
1 changed files with 8 additions and 0 deletions
|
|
@ -49,6 +49,14 @@ class ParsoidTestFileSuite extends TestSuite {
|
|||
|
||||
$validTestModes = $this->ptRunner->getRequestedTestModes();
|
||||
$skipMode = new ParserTestMode( $validTestModes[0] );
|
||||
$modeRestriction = $this->ptFileInfo->fileOptions['parsoid-compatible'] ?? false;
|
||||
if ( $modeRestriction !== false ) {
|
||||
if ( is_string( $modeRestriction ) ) {
|
||||
// shorthand
|
||||
$modeRestriction = [ $modeRestriction ];
|
||||
}
|
||||
$validTestModes = array_intersect( $validTestModes, $modeRestriction );
|
||||
}
|
||||
|
||||
$suite = $this;
|
||||
foreach ( $this->ptFileInfo->testCases as $t ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue