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""" 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 32class MissingPackageNameError(Exception): 33 """Raised when the test class java file does not contain a package name.""" 34 35class TooManyMethodsError(Exception): 36 """Raised when input string contains more than one # character.""" 37 38class MethodWithoutClassError(Exception): 39 """Raised when method is appended via # but no class file specified.""" 40 41class 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 56class FatalIncludeError(SyntaxError): 57 """Raised if expanding include tag fails.""" 58