From 22f62079205fed50ec70f32c3f8639da5b6e6a6e Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 7 Mar 2014 10:03:17 -0800 Subject: [PATCH] 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 --- src/lint/linter/__tests__/ArcanistLinterTestCase.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php index 24d385ff..5f9f7b3e 100644 --- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php +++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php @@ -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) { -- 2.43.0