mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-29 10:12:41 +01:00
Link Arcanist test cases
Summary: See D3455. Test Plan: This diff (after rebase). Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3460
This commit is contained in:
parent
e3601cfe30
commit
af31ee4ed0
11 changed files with 49 additions and 18 deletions
|
@ -113,6 +113,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php',
|
'ArcanistSubversionHookAPI' => 'repository/hookapi/ArcanistSubversionHookAPI.php',
|
||||||
'ArcanistSvnHookPreCommitWorkflow' => 'workflow/ArcanistSvnHookPreCommitWorkflow.php',
|
'ArcanistSvnHookPreCommitWorkflow' => 'workflow/ArcanistSvnHookPreCommitWorkflow.php',
|
||||||
'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php',
|
'ArcanistTasksWorkflow' => 'workflow/ArcanistTasksWorkflow.php',
|
||||||
|
'ArcanistTestCase' => 'infrastructure/testing/ArcanistTestCase.php',
|
||||||
'ArcanistTextLinter' => 'lint/linter/ArcanistTextLinter.php',
|
'ArcanistTextLinter' => 'lint/linter/ArcanistTextLinter.php',
|
||||||
'ArcanistTextLinterTestCase' => 'lint/linter/__tests__/ArcanistTextLinterTestCase.php',
|
'ArcanistTextLinterTestCase' => 'lint/linter/__tests__/ArcanistTextLinterTestCase.php',
|
||||||
'ArcanistTodoWorkflow' => 'workflow/ArcanistTodoWorkflow.php',
|
'ArcanistTodoWorkflow' => 'workflow/ArcanistTodoWorkflow.php',
|
||||||
|
@ -148,21 +149,21 @@ phutil_register_library_map(array(
|
||||||
'ArcanistAnoidWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistAnoidWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistApacheLicenseLinter' => 'ArcanistLicenseLinter',
|
'ArcanistApacheLicenseLinter' => 'ArcanistLicenseLinter',
|
||||||
'ArcanistApacheLicenseLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistApacheLicenseLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ArcanistBaseCommitParserTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistBaseCommitParserTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistBranchWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistBranchWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistBundleTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistBundleTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistCallConduitWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistCallConduitWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistCapabilityNotSupportedException' => 'Exception',
|
'ArcanistCapabilityNotSupportedException' => 'Exception',
|
||||||
'ArcanistChooseInvalidRevisionException' => 'Exception',
|
'ArcanistChooseInvalidRevisionException' => 'Exception',
|
||||||
'ArcanistChooseNoRevisionsException' => 'Exception',
|
'ArcanistChooseNoRevisionsException' => 'Exception',
|
||||||
'ArcanistCloseRevisionWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistCloseRevisionWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistCloseWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistCloseWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistCommentRemoverTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistCommentRemoverTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistCommitWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistCommitWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistConduitLinter' => 'ArcanistLinter',
|
'ArcanistConduitLinter' => 'ArcanistLinter',
|
||||||
'ArcanistCoverWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistCoverWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistDiffParserTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistDiffParserTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistDiffUtilsTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistDiffUtilsTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistDiffWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistDiffWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistDifferentialCommitMessageParserException' => 'Exception',
|
'ArcanistDifferentialCommitMessageParserException' => 'Exception',
|
||||||
'ArcanistDownloadWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistDownloadWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
|
@ -188,11 +189,11 @@ phutil_register_library_map(array(
|
||||||
'ArcanistLintLikeCompilerRenderer' => 'ArcanistLintRenderer',
|
'ArcanistLintLikeCompilerRenderer' => 'ArcanistLintRenderer',
|
||||||
'ArcanistLintSummaryRenderer' => 'ArcanistLintRenderer',
|
'ArcanistLintSummaryRenderer' => 'ArcanistLintRenderer',
|
||||||
'ArcanistLintWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistLintWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistLinterTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistLinterTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistListWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistListWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistMarkCommittedWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistMarkCommittedWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
|
'ArcanistMercurialAPI' => 'ArcanistRepositoryAPI',
|
||||||
'ArcanistMercurialParserTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistMercurialParserTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistNoEffectException' => 'ArcanistUsageException',
|
'ArcanistNoEffectException' => 'ArcanistUsageException',
|
||||||
'ArcanistNoEngineException' => 'ArcanistUsageException',
|
'ArcanistNoEngineException' => 'ArcanistUsageException',
|
||||||
'ArcanistNoLintLinter' => 'ArcanistLinter',
|
'ArcanistNoLintLinter' => 'ArcanistLinter',
|
||||||
|
@ -217,6 +218,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistSubversionHookAPI' => 'ArcanistHookAPI',
|
'ArcanistSubversionHookAPI' => 'ArcanistHookAPI',
|
||||||
'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistSvnHookPreCommitWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistTasksWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistTasksWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
|
'ArcanistTestCase' => 'ArcanistPhutilTestCase',
|
||||||
'ArcanistTextLinter' => 'ArcanistLinter',
|
'ArcanistTextLinter' => 'ArcanistLinter',
|
||||||
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistTextLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ArcanistTodoWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistTodoWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
|
@ -227,7 +229,7 @@ phutil_register_library_map(array(
|
||||||
'ArcanistUsageException' => 'Exception',
|
'ArcanistUsageException' => 'Exception',
|
||||||
'ArcanistUserAbortException' => 'ArcanistUsageException',
|
'ArcanistUserAbortException' => 'ArcanistUsageException',
|
||||||
'ArcanistWhichWorkflow' => 'ArcanistBaseWorkflow',
|
'ArcanistWhichWorkflow' => 'ArcanistBaseWorkflow',
|
||||||
'ArcanistXHPASTLintNamingHookTestCase' => 'ArcanistPhutilTestCase',
|
'ArcanistXHPASTLintNamingHookTestCase' => 'ArcanistTestCase',
|
||||||
'ArcanistXHPASTLinter' => 'ArcanistLinter',
|
'ArcanistXHPASTLinter' => 'ArcanistLinter',
|
||||||
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase',
|
||||||
'ComprehensiveLintEngine' => 'ArcanistLintEngine',
|
'ComprehensiveLintEngine' => 'ArcanistLintEngine',
|
||||||
|
@ -236,7 +238,7 @@ phutil_register_library_map(array(
|
||||||
'PhpunitTestEngine' => 'ArcanistBaseUnitTestEngine',
|
'PhpunitTestEngine' => 'ArcanistBaseUnitTestEngine',
|
||||||
'PhutilLintEngine' => 'ArcanistLintEngine',
|
'PhutilLintEngine' => 'ArcanistLintEngine',
|
||||||
'PhutilUnitTestEngine' => 'ArcanistBaseUnitTestEngine',
|
'PhutilUnitTestEngine' => 'ArcanistBaseUnitTestEngine',
|
||||||
'PhutilUnitTestEngineTestCase' => 'ArcanistPhutilTestCase',
|
'PhutilUnitTestEngineTestCase' => 'ArcanistTestCase',
|
||||||
'UnitTestableArcanistLintEngine' => 'ArcanistLintEngine',
|
'UnitTestableArcanistLintEngine' => 'ArcanistLintEngine',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
* @group testcase
|
* @group testcase
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffUtilsTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistDiffUtilsTestCase extends ArcanistTestCase {
|
||||||
public function testLevenshtein() {
|
public function testLevenshtein() {
|
||||||
$tests = array(
|
$tests = array(
|
||||||
array(
|
array(
|
||||||
|
|
29
src/infrastructure/testing/ArcanistTestCase.php
Normal file
29
src/infrastructure/testing/ArcanistTestCase.php
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2012 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abstract class ArcanistTestCase extends ArcanistPhutilTestCase {
|
||||||
|
|
||||||
|
protected function getLink($method) {
|
||||||
|
$arcanist_project = 'PHID-APRJ-703e0b140530f17ede30';
|
||||||
|
return
|
||||||
|
'https://secure.phabricator.com/diffusion/symbol/'.$method.
|
||||||
|
'/?lang=php&projects='.$arcanist_project.
|
||||||
|
'&jump=true&context='.get_class($this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
* @group testcase
|
* @group testcase
|
||||||
*/
|
*/
|
||||||
abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
|
abstract class ArcanistLinterTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function executeTestsInDirectory($root, $linter, $working_copy) {
|
public function executeTestsInDirectory($root, $linter, $working_copy) {
|
||||||
foreach (Filesystem::listDirectory($root, $hidden = false) as $file) {
|
foreach (Filesystem::listDirectory($root, $hidden = false) as $file) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* @group testcase
|
* @group testcase
|
||||||
*/
|
*/
|
||||||
final class ArcanistXHPASTLintNamingHookTestCase
|
final class ArcanistXHPASTLintNamingHookTestCase
|
||||||
extends ArcanistPhutilTestCase {
|
extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testCaseUtilities() {
|
public function testCaseUtilities() {
|
||||||
$tests = array(
|
$tests = array(
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class ArcanistBaseCommitParserTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistBaseCommitParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testBasics() {
|
public function testBasics() {
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class ArcanistBundleTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistBundleTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
private function loadResource($name) {
|
private function loadResource($name) {
|
||||||
return Filesystem::readFile($this->getResourcePath($name));
|
return Filesystem::readFile($this->getResourcePath($name));
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class ArcanistCommentRemoverTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistCommentRemoverTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testRemover() {
|
public function testRemover() {
|
||||||
$test = <<<EOTEXT
|
$test = <<<EOTEXT
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
* @group testcase
|
* @group testcase
|
||||||
*/
|
*/
|
||||||
final class ArcanistDiffParserTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistDiffParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testParser() {
|
public function testParser() {
|
||||||
$root = dirname(__FILE__).'/diff/';
|
$root = dirname(__FILE__).'/diff/';
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
final class ArcanistMercurialParserTestCase extends ArcanistPhutilTestCase {
|
final class ArcanistMercurialParserTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
public function testParseAll() {
|
public function testParseAll() {
|
||||||
$root = dirname(__FILE__).'/mercurial/';
|
$root = dirname(__FILE__).'/mercurial/';
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
* @group testcase
|
* @group testcase
|
||||||
*/
|
*/
|
||||||
final class PhutilUnitTestEngineTestCase extends ArcanistPhutilTestCase {
|
final class PhutilUnitTestEngineTestCase extends ArcanistTestCase {
|
||||||
|
|
||||||
static $allTestsCounter = 0;
|
static $allTestsCounter = 0;
|
||||||
static $oneTestCounter = 0;
|
static $oneTestCounter = 0;
|
||||||
|
|
Loading…
Reference in a new issue