jenkins-bot has submitted this change and it was merged.
Change subject: Register unit tests automatically
......................................................................
Register unit tests automatically
The big conflict to end all other conflicts! :)
Change-Id: I950d1d775752d617d7df56465e6cb187b0c7febb
---
M SemanticMediaWiki.hooks.php
1 file changed, 8 insertions(+), 63 deletions(-)
Approvals:
Mwjames: Looks good to me, approved
jenkins-bot: Verified
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: merged
Gerrit-Change-Id: I950d1d775752d617d7df56465e6cb187b0c7febb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Mwjames <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits