1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Minor cleanup of linter testing code.

Summary:
Just some minor cleaning up, including:

- Removing old annotations for Diviner.
- Renaming some `lint-test` files so that the directory name bears a closer resemblance to that of the linter.
- Remove some useless `return` statements.

Test Plan: `arc unit`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9096
This commit is contained in:
Joshua Spence 2014-05-13 06:16:02 -07:00 committed by epriestley
parent c4c0fbd7cd
commit d826bf65c6
14 changed files with 17 additions and 61 deletions

View file

@ -1,8 +1,5 @@
<?php
/**
* @group testcase
*/
abstract class ArcanistArcanistLinterTestCase extends ArcanistLinterTestCase {
protected function getLink($method) {

View file

@ -1,15 +1,11 @@
<?php
/**
* Test cases for @{class:ArcanistCpplintLinter}.
*
* @group testcase
*/
final class ArcanistCpplintLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testCpplintLint() {
return $this->executeTestsInDirectory(
dirname(__FILE__).'/cpp/',
dirname(__FILE__).'/cpplint/',
new ArcanistCpplintLinter());
}

View file

@ -1,14 +1,10 @@
<?php
/**
* Test cases for @{class:ArcanistFlake8Linter}.
*
* @group testcase
*/
final class ArcanistFlake8LinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testFlake8Lint() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/flake8/',
new ArcanistFlake8Linter());
}

View file

@ -2,8 +2,6 @@
/**
* Facilitates implementation of test cases for @{class:ArcanistLinter}s.
*
* @group testcase
*/
abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
@ -154,7 +152,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
$char = $message->getChar();
$code = $message->getCode();
$name = $message->getName();
$message_key = $sev.":".$line.":".$char;
$message_key = $sev.':'.$line.':'.$char;
$message_map[$message_key] = $message;
$seen[] = $message_key;
$raised[] = " {$sev} at line {$line}, char {$char}: {$code} {$name}";
@ -173,7 +171,7 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
$seen = array_fill_keys($seen, true);
if (!$raised) {
$raised = array("No messages.");
$raised = array('No messages.');
}
$raised = "Actually raised:\n".implode("\n", $raised);
@ -186,7 +184,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
}
foreach (array_diff_key($seen, $expect) as $surprising => $ignored) {
$message = $message_map[$surprising];
$message_info = $message->getDescription();
@ -205,6 +202,6 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
$this->assertEqual(
$expected,
$actual,
"File as patched by lint did not match the expected patched file.");
'File as patched by lint did not match the expected patched file.');
}
}

View file

@ -1,13 +1,6 @@
<?php
/**
* Test for @{class:ArcanistNoLintLinter}.
*
* Not a real test... meant to fail lint
* if @nolint is not respected.
*
* @group testcase
* Not a real test... meant to fail lint if @nolint is not respected.
*/
final class ArcanistNoLintTestCaseMisnamed extends ArcanistLinterTestCase {
}
final class ArcanistNoLintTestCaseMisnamed extends ArcanistLinterTestCase {}

View file

@ -3,7 +3,7 @@
final class ArcanistPHPCSLinterTestCase extends ArcanistArcanistLinterTestCase {
public function testPHPCSLint() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/phpcs/',
new ArcanistPhpcsLinter());
}

View file

@ -1,8 +1,5 @@
<?php
/**
* @group testcase
*/
final class ArcanistPhutilXHPASTLinterTestCase
extends ArcanistArcanistLinterTestCase {
@ -12,7 +9,7 @@ final class ArcanistPhutilXHPASTLinterTestCase
'deprecated_function' => 'This function is most likely deprecated.',
));
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/phlxhp/',
$linter);
}

View file

@ -4,7 +4,7 @@ final class ArcanistPuppetLintLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testPuppetLintLinter() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/puppet-lint/',
new ArcanistPuppetLintLinter());
}

View file

@ -4,7 +4,7 @@ final class ArcanistPyFlakesLinterTestCase
extends ArcanistArcanistLinterTestCase {
public function testPyflakesLinter() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/pyflakes/',
new ArcanistPyFlakesLinter());
}

View file

@ -1,14 +1,9 @@
<?php
/**
* Test cases for @{class:ArcanistRubyLinter}.
*
* @group testcase
*/
final class ArcanistRubyLinterTestCase extends ArcanistArcanistLinterTestCase {
public function testRubyLint() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/ruby/',
new ArcanistRubyLinter());
}

View file

@ -1,10 +1,5 @@
<?php
/**
* Test cases for @{class:ArcanistSpellingLinter}.
*
* @group testcase
*/
final class ArcanistSpellingLinterTestCase
extends ArcanistArcanistLinterTestCase {
@ -13,7 +8,7 @@ final class ArcanistSpellingLinterTestCase
$linter->addPartialWordRule('supermn', 'superman');
$linter->addWholeWordRule('batmn', 'batman');
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/spelling/',
$linter);
}

View file

@ -1,14 +1,9 @@
<?php
/**
* Test cases for @{class:ArcanistTextLinter}.
*
* @group testcase
*/
final class ArcanistTextLinterTestCase extends ArcanistArcanistLinterTestCase {
public function testTextLint() {
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/text/',
new ArcanistTextLinter());
}

View file

@ -1,10 +1,5 @@
<?php
/**
* Tests for @{class:ArcanistXHPASTLinter}.
*
* @group testcase
*/
final class ArcanistXHPASTLinterTestCase
extends ArcanistArcanistLinterTestCase {
@ -17,7 +12,7 @@ final class ArcanistXHPASTLinterTestCase
=> ArcanistLintSeverity::SEVERITY_WARNING,
));
return $this->executeTestsInDirectory(
$this->executeTestsInDirectory(
dirname(__FILE__).'/xhpast/',
$linter);
}