1# 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"""atest exceptions."""
16
17
18class UnsupportedModuleTestError(Exception):
19  """Error raised when we find a module that we don't support."""
20
21
22class TestDiscoveryException(Exception):
23  """Base Exception for issues with test discovery."""
24
25
26class NoTestFoundError(TestDiscoveryException):
27  """Raised when no tests are found."""
28
29
30class TestWithNoModuleError(TestDiscoveryException):
31  """Raised when test files have no parent module directory."""
32
33
34class MethodWithoutClassError(TestDiscoveryException):
35  """Raised when method is appended via # but no class file specified."""
36
37
38class UnknownTestRunnerError(Exception):
39  """Raised when an unknown test runner is specified."""
40
41
42class NoTestRunnerName(Exception):
43  """Raised when Test Runner class var NAME isn't defined."""
44
45
46class NoTestRunnerExecutable(Exception):
47  """Raised when Test Runner class var EXECUTABLE isn't defined."""
48
49
50class HostEnvCheckFailed(Exception):
51  """Raised when Test Runner's host env check fails."""
52
53
54class ShouldNeverBeCalledError(Exception):
55  """Raised when something is called when it shouldn't, used for testing."""
56
57
58class FatalIncludeError(TestDiscoveryException):
59  """Raised if expanding include tag fails."""
60
61
62class MissingCCTestCaseError(TestDiscoveryException):
63  """Raised when the cc file does not contain a test case class."""
64
65
66class XmlNotExistError(TestDiscoveryException):
67  """Raised when the xml file does not exist."""
68
69
70class DryRunVerificationError(Exception):
71  """Base Exception if verification fail."""
72