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

Fail lint tests if no tests are found in the test directory

Summary: Ref T4570. Testing a directory with no recognized tests currently passes, but should fail.

Test Plan:
  - Ran `arc unit`.
  - Removed tests from a test directory, ran `arc unit`, got test failure.

Reviewers: leebyron, btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4570

Differential Revision: https://secure.phabricator.com/D8434
This commit is contained in:
epriestley 2014-03-07 10:03:17 -08:00
parent 18251a1bd8
commit 22f6207920

View file

@ -13,9 +13,16 @@ abstract class ArcanistLinterTestCase extends ArcanistPhutilTestCase {
->withSuffix('lint-test')
->find();
$test_count = 0;
foreach ($files as $file) {
$this->lintFile($root.$file, $linter);
$test_count++;
}
$this->assertEqual(
true,
($test_count > 0),
pht('Expected to find some .lint-test tests in directory %s!', $root));
}
private function lintFile($file, $linter) {