blob: 7ab8b5fee429f8d44715f0cb27100f41a7858acd [file] [log] [blame]
Kevin Cheng8b2c94c2017-12-18 14:43:26 -08001# Copyright 2018, The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""
16atest exceptions.
17"""
18
19
20class UnsupportedModuleTestError(Exception):
21 """Error raised when we find a module that we don't support."""
22
23class TestDiscoveryException(Exception):
24 """Base Exception for issues with test discovery."""
25
26class NoTestFoundError(TestDiscoveryException):
27 """Raised when no tests are found."""
28
29class TestWithNoModuleError(TestDiscoveryException):
30 """Raised when test files have no parent module directory."""
31
nelsonlic4a71452018-09-13 14:10:30 +080032class MissingPackageNameError(TestDiscoveryException):
Kevin Cheng8b2c94c2017-12-18 14:43:26 -080033 """Raised when the test class java file does not contain a package name."""
34
nelsonlic4a71452018-09-13 14:10:30 +080035class TooManyMethodsError(TestDiscoveryException):
Kevin Cheng8b2c94c2017-12-18 14:43:26 -080036 """Raised when input string contains more than one # character."""
37
nelsonlic4a71452018-09-13 14:10:30 +080038class MethodWithoutClassError(TestDiscoveryException):
mikehoran6740a412018-02-20 15:04:16 -080039 """Raised when method is appended via # but no class file specified."""
40
Kevin Cheng8b2c94c2017-12-18 14:43:26 -080041class UnknownTestRunnerError(Exception):
42 """Raised when an unknown test runner is specified."""
43
44class NoTestRunnerName(Exception):
45 """Raised when Test Runner class var NAME isn't defined."""
46
47class NoTestRunnerExecutable(Exception):
48 """Raised when Test Runner class var EXECUTABLE isn't defined."""
49
50class HostEnvCheckFailed(Exception):
51 """Raised when Test Runner's host env check fails."""
52
53class ShouldNeverBeCalledError(Exception):
54 """Raised when something is called when it shouldn't, used for testing."""
55
nelsonlic4a71452018-09-13 14:10:30 +080056class FatalIncludeError(TestDiscoveryException):
Kevin Cheng8b2c94c2017-12-18 14:43:26 -080057 """Raised if expanding include tag fails."""
kellyhungf4b59472018-05-10 17:00:10 +080058
nelsonlic4a71452018-09-13 14:10:30 +080059class MissingCCTestCaseError(TestDiscoveryException):
kellyhungf4b59472018-05-10 17:00:10 +080060 """Raised when the cc file does not contain a test case class."""
kellyhungd69de382018-08-07 18:32:58 +080061
nelsonlic4a71452018-09-13 14:10:30 +080062class XmlNotExistError(TestDiscoveryException):
kellyhungd69de382018-08-07 18:32:58 +080063 """Raised when the xml file does not exist."""
yangbillbac1dd62019-06-03 17:06:40 +080064
65class DryRunVerificationError(Exception):
66 """Base Exception if verification fail."""