1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 02:42:40 +01:00

Add test to check all symbols can be loaded

Summary:
make sure all symboles can be loaded to avoid issues like missing
methods in descendants of abstract base class.

Test Plan:
ran it and verified it passes; remove a method in a descendant class
and verified that the test failed.

Reviewers: epriestley, nh

Reviewed By: nh

CC: aran, nh, jungejason

Differential Revision: 1023
This commit is contained in:
Jason Ge 2011-10-19 18:26:21 -07:00
parent f447e5d709
commit 13eee1a344
5 changed files with 60 additions and 0 deletions

View file

@ -25,6 +25,13 @@ fi
(cd $ROOT/phabricator && git pull && git submodule update --init) (cd $ROOT/phabricator && git pull && git submodule update --init)
### RUN TESTS ##################################################################
# This is an acceptance test that makes sure all symboles can be loaded to
# avoid issues like missing methods in descendants of abstract base class.
(cd $ROOT/phabricator && ../arcanist/bin/arc unit src/infrastructure/__tests__/)
### GENERATE DOCUMENTATION ##################################################### ### GENERATE DOCUMENTATION #####################################################
# This generates documentation if you have diviner/ checked out. You generally # This generates documentation if you have diviner/ checked out. You generally
@ -38,6 +45,7 @@ then
(cd $ROOT/phabricator && $ROOT/diviner/bin/diviner .) (cd $ROOT/phabricator && $ROOT/diviner/bin/diviner .)
fi fi
### CYCLE APACHE AND DAEMONS ################################################### ### CYCLE APACHE AND DAEMONS ###################################################
# Stop Apache. Depening on what system you're running, you may need to use # Stop Apache. Depening on what system you're running, you may need to use

View file

@ -469,6 +469,7 @@ phutil_register_library_map(array(
'PhabricatorIRCObjectNameHandler' => 'infrastructure/daemon/irc/handler/objectname', 'PhabricatorIRCObjectNameHandler' => 'infrastructure/daemon/irc/handler/objectname',
'PhabricatorIRCProtocolHandler' => 'infrastructure/daemon/irc/handler/protocol', 'PhabricatorIRCProtocolHandler' => 'infrastructure/daemon/irc/handler/protocol',
'PhabricatorImageTransformer' => 'applications/files/transform', 'PhabricatorImageTransformer' => 'applications/files/transform',
'PhabricatorInfrastructureTestCase' => 'infrastructure/__tests__',
'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/javelin', 'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/javelin',
'PhabricatorLintEngine' => 'infrastructure/lint/engine', 'PhabricatorLintEngine' => 'infrastructure/lint/engine',
'PhabricatorLiskDAO' => 'applications/base/storage/lisk', 'PhabricatorLiskDAO' => 'applications/base/storage/lisk',
@ -1099,6 +1100,7 @@ phutil_register_library_map(array(
'PhabricatorIRCBot' => 'PhabricatorDaemon', 'PhabricatorIRCBot' => 'PhabricatorDaemon',
'PhabricatorIRCObjectNameHandler' => 'PhabricatorIRCHandler', 'PhabricatorIRCObjectNameHandler' => 'PhabricatorIRCHandler',
'PhabricatorIRCProtocolHandler' => 'PhabricatorIRCHandler', 'PhabricatorIRCProtocolHandler' => 'PhabricatorIRCHandler',
'PhabricatorInfrastructureTestCase' => 'PhabricatorTestCase',
'PhabricatorJavelinLinter' => 'ArcanistLinter', 'PhabricatorJavelinLinter' => 'ArcanistLinter',
'PhabricatorLintEngine' => 'PhutilLintEngine', 'PhabricatorLintEngine' => 'PhutilLintEngine',
'PhabricatorLiskDAO' => 'LiskDAO', 'PhabricatorLiskDAO' => 'LiskDAO',

View file

@ -9,6 +9,7 @@
phutil_require_module('phabricator', 'aphront/response/redirect'); phutil_require_module('phabricator', 'aphront/response/redirect');
phutil_require_module('phabricator', 'applications/diffusion/controller/base'); phutil_require_module('phabricator', 'applications/diffusion/controller/base');
phutil_require_module('phabricator', 'applications/diffusion/query/symbol'); phutil_require_module('phabricator', 'applications/diffusion/query/symbol');
phutil_require_module('phabricator', 'applications/diffusion/request/base');
phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject'); phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject');
phutil_require_module('phabricator', 'applications/repository/storage/repository'); phutil_require_module('phabricator', 'applications/repository/storage/repository');
phutil_require_module('phabricator', 'storage/queryfx'); phutil_require_module('phabricator', 'storage/queryfx');

View file

@ -0,0 +1,34 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class PhabricatorInfrastructureTestCase
extends PhabricatorTestCase {
/**
* This is more of an acceptance test case instead of a unittest. It verifies
* that all symbols can be loaded correctly. It can catch problem like missing
* methods in descendants of abstract base classes.
*/
public function testEverythingImplemented() {
// Note that we don't have a try catch block around the following because,
// when it fails, it will cause a HPHP or PHP fatal which won't be caught
// by try catch.
$every_class = id(new PhutilSymbolLoader())->selectAndLoadSymbols();
}
}

View file

@ -0,0 +1,15 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'infrastructure/testing/testcase');
phutil_require_module('phutil', 'symbols');
phutil_require_module('phutil', 'utils');
phutil_require_source('PhabricatorInfrastructureTestCase.php');