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