1 /* 2 * Copyright (C) 2015 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.testtype; 17 18 import java.util.Set; 19 20 /** 21 * A runner that can filter which tests to run. 22 * 23 * <p>A test will be run IFF it matches one or more of the include filters AND does not match any 24 * of the exclude filters. If no include filters are given all tests should be run as long as they 25 * do not match any of the exclude filters.</p> 26 * 27 * <p>The format of the filters is defined by the runner, and could be structured as 28 * <package>, <package>.<class>, <package>.<class>#<method> or 29 * <native_name>. They can even be regexes.</p> 30 */ 31 public interface ITestFilterReceiver { 32 33 /** 34 * Adds a filter of which tests to include. 35 */ addIncludeFilter(String filter)36 void addIncludeFilter(String filter); 37 38 /** 39 * Adds the {@link Set} of filters of which tests to include. 40 */ addAllIncludeFilters(Set<String> filters)41 void addAllIncludeFilters(Set<String> filters); 42 43 /** 44 * Adds a filter of which tests to exclude. 45 */ addExcludeFilter(String filter)46 void addExcludeFilter(String filter); 47 48 /** 49 * Adds the {@link Set} of filters of which tests to exclude. 50 */ addAllExcludeFilters(Set<String> filters)51 void addAllExcludeFilters(Set<String> filters); 52 } 53