Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67449


Change subject: Register unit tests automatically
......................................................................

Register unit tests automatically

Change-Id: I950d1d775752d617d7df56465e6cb187b0c7febb
---
M SemanticMediaWiki.hooks.php
1 file changed, 8 insertions(+), 63 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki 
refs/changes/49/67449/1

diff --git a/SemanticMediaWiki.hooks.php b/SemanticMediaWiki.hooks.php
index b1cc520..168a3e7 100644
--- a/SemanticMediaWiki.hooks.php
+++ b/SemanticMediaWiki.hooks.php
@@ -240,70 +240,15 @@
        * @return boolean
        */
        public static function registerUnitTests( array &$files ) {
-               $testFiles = array(
-                       'Defines',
-                       'GlobalFunctions',
-                       'FormatFactory',
-                       'Highlighter',
-                       'ObservableMessageReporter',
-                       'ParserData',
-                       'Subobject',
-                       'RecurringEvents',
-                       'Infolink',
-                       'Hooks',
-                       'DataValueFactory',
-                       'Settings',
-                       'ParserTextProcessor',
-                       'Factbox',
+               $directoryIterator = new RecursiveDirectoryIterator( __DIR__ . 
'/tests/phpunit/includes/' );
 
-                       'formatters/ParserParameterFormatter',
-
-                       'handlers/CacheHandler',
-
-                       'api/ApiSMWInfo',
-                       'api/ApiAsk',
-
-                       'query/QueryProcessor',
-
-                       'dataitems/DI_Blob',
-                       'dataitems/DI_Bool',
-                       'dataitems/DI_Number',
-                       'dataitems/DI_GeoCoord',
-                       'dataitems/DISerializer',
-                       'dataitems/DIConcept',
-
-                       'export/SMWExpElement',
-
-                       'parserhooks/SubobjectParserFunction',
-                       'parserhooks/RecurringEventsParserFunction',
-                       'parserhooks/AskParserFunction',
-                       'parserhooks/ShowParserFunction',
-                       'parserhooks/ConceptParserFunction',
-                       'parserhooks/DeclareParserFunction',
-                       'parserhooks/DocumentationParserFunction',
-                       'parserhooks/InfoParserFunction',
-                       'parserhooks/SetParserFunction',
-
-                       'query/QueryData',
-
-                       'printers/ResultPrinters',
-                       'printers/AggregatablePrinter',
-
-                       'resources/Resources',
-
-                       'specials/Specials',
-                       'specials/WantedPropertiesPage',
-
-                       // Keep store tests near the end, since they are slower 
due to database access.
-                       'storage/StoreFactory',
-                       'storage/Store',
-
-                       'storage/sqlstore/PropertyStatisticsTable',
-                       'storage/sqlstore/DIHandlerWikiPage'
-               );
-
-               foreach ( $testFiles as $file ) {
-                       $files[] = dirname( __FILE__ ) . 
'/tests/phpunit/includes/' . $file . 'Test.php';
+               /**
+                * @var SplFileInfo $fileInfo
+                */
+               foreach ( new RecursiveIteratorIterator( $directoryIterator ) 
as $fileInfo ) {
+                       if ( substr( $fileInfo->getFilename(), -8 ) === 
'Test.php' ) {
+                               $files[] = $fileInfo->getPathname();
+                       }
                }
 
                return true;

-- 
To view, visit https://gerrit.wikimedia.org/r/67449
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I950d1d775752d617d7df56465e6cb187b0c7febb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to