1 /* 2 * Copyright (C) 2017 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.suite.module; 17 18 import com.android.tradefed.device.DeviceNotAvailableException; 19 import com.android.tradefed.invoker.IInvocationContext; 20 21 /** Interface for controlling if a module should be executed or not. */ 22 public interface IModuleController { 23 24 /** Enum describing how the module should be executed. */ 25 public enum RunStrategy { 26 // Run the full module 27 RUN, 28 // Completely skip the module and report nothing 29 FULL_MODULE_BYPASS, 30 // Report all tests in the module as SKIPPED 31 SKIP_MODULE_TESTCASES 32 } 33 34 /** 35 * Method to determine if a module should run or not. 36 * 37 * @param context the {@link IInvocationContext} of the module. 38 * @return True if the module should run, false otherwise. 39 */ shouldRunModule(IInvocationContext context)40 public RunStrategy shouldRunModule(IInvocationContext context) 41 throws DeviceNotAvailableException; 42 } 43