1*c2e18aaaSAndroid Build Coastguard Worker# Copyright 2018, The Android Open Source Project 2*c2e18aaaSAndroid Build Coastguard Worker# 3*c2e18aaaSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 4*c2e18aaaSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 5*c2e18aaaSAndroid Build Coastguard Worker# You may obtain a copy of the License at 6*c2e18aaaSAndroid Build Coastguard Worker# 7*c2e18aaaSAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 8*c2e18aaaSAndroid Build Coastguard Worker# 9*c2e18aaaSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 10*c2e18aaaSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 11*c2e18aaaSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*c2e18aaaSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 13*c2e18aaaSAndroid Build Coastguard Worker# limitations under the License. 14*c2e18aaaSAndroid Build Coastguard Worker 15*c2e18aaaSAndroid Build Coastguard Worker"""Example Finder class.""" 16*c2e18aaaSAndroid Build Coastguard Worker 17*c2e18aaaSAndroid Build Coastguard Workerfrom atest.test_finders import test_finder_base 18*c2e18aaaSAndroid Build Coastguard Workerfrom atest.test_finders import test_info 19*c2e18aaaSAndroid Build Coastguard Workerfrom atest.test_runners import example_test_runner 20*c2e18aaaSAndroid Build Coastguard Worker 21*c2e18aaaSAndroid Build Coastguard Worker 22*c2e18aaaSAndroid Build Coastguard Worker@test_finder_base.find_method_register 23*c2e18aaaSAndroid Build Coastguard Workerclass ExampleFinder(test_finder_base.TestFinderBase): 24*c2e18aaaSAndroid Build Coastguard Worker """Example finder class.""" 25*c2e18aaaSAndroid Build Coastguard Worker 26*c2e18aaaSAndroid Build Coastguard Worker NAME = 'EXAMPLE' 27*c2e18aaaSAndroid Build Coastguard Worker _TEST_RUNNER = example_test_runner.ExampleTestRunner.NAME 28*c2e18aaaSAndroid Build Coastguard Worker 29*c2e18aaaSAndroid Build Coastguard Worker @test_finder_base.register() 30*c2e18aaaSAndroid Build Coastguard Worker def find_method_from_example_finder(self, test): 31*c2e18aaaSAndroid Build Coastguard Worker """Example find method to demonstrate how to register it.""" 32*c2e18aaaSAndroid Build Coastguard Worker if test == 'ExampleFinderTest': 33*c2e18aaaSAndroid Build Coastguard Worker return test_info.TestInfo( 34*c2e18aaaSAndroid Build Coastguard Worker test_name=test, test_runner=self._TEST_RUNNER, build_targets=set() 35*c2e18aaaSAndroid Build Coastguard Worker ) 36*c2e18aaaSAndroid Build Coastguard Worker return None 37