Merge "test: skip math parser tests when missing $wgTexvc"
authorTheDJ <hartman.wiki@gmail.com>
Mon, 1 Jul 2013 17:06:22 +0000 (17:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 1 Jul 2013 17:06:22 +0000 (17:06 +0000)
tests/phpunit/includes/parser/NewParserTest.php

index 93923fd..54c7fb5 100644 (file)
@@ -320,7 +320,7 @@ class NewParserTest extends MediaWikiTestCase {
                        'wgRawHtml' => isset( $opts['rawhtml'] ),
                        'wgNamespacesWithSubpages' => array( NS_MAIN => isset( $opts['subpage'] ) ),
                        'wgMaxTocLevel' => $maxtoclevel,
-                       'wgUseTeX' => isset( $opts['math'] ),
+                       'wgUseTeX' => isset( $opts['math'] ) || isset( $opts['texvc'] ),
                        'wgMathDirectory' => $uploadDir . '/math',
                        'wgDefaultLanguageVariant' => $variant,
                        'wgLinkHolderBatchSize' => $linkHolderBatchSize,
@@ -580,6 +580,20 @@ class NewParserTest extends MediaWikiTestCase {
 
                $title = Title::newFromText( $titleText );
 
+               # Parser test requiring math. Make sure texvc is executable
+               # or just skip such tests.
+               if ( isset( $opts['math'] ) || isset( $opts['texvc'] ) ) {
+                       global $wgTexvc;
+
+                       if ( !isset( $wgTexvc ) ) {
+                               $this->markTestSkipped( "SKIPPED: \$wgTexvc is not set" );
+                       } elseif ( !is_executable( $wgTexvc ) ) {
+                               $this->markTestSkipped( "SKIPPED: texvc binary does not exist"
+                                       . " or is not executable.\n"
+                                       . "Current configuration is:\n\$wgTexvc = '$wgTexvc'" );
+                       }
+               }
+
                if ( isset( $opts['pst'] ) ) {
                        $out = $parser->preSaveTransform( $input, $title, $user, $options );
                } elseif ( isset( $opts['msg'] ) ) {