• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 
17 package vogar;
18 
19 /**
20  * The type of runner to use for the test classes.
21  */
22 public enum RunnerType {
23     /**
24      * Runs both JUnit classes and classes with a main(String[] args) method.
25      */
26     DEFAULT(false, true, true),
27 
28     /**
29      * Runs only Caliper benchmarks.
30      */
31     CALIPER(true, false, false),
32 
33     /**
34      * Runs only JUnit classes.
35      */
36     JUNIT(false, true, false),
37 
38     /**
39      * Runs only classes with a main(String[] args) method.
40      */
41     MAIN(false, false, true);
42 
43     private final boolean supportsCaliper;
44     private final boolean supportsJUnit;
45     private final boolean supportsMain;
46 
RunnerType(boolean supportsCaliper, boolean supportsJUnit, boolean supportsMain)47     RunnerType(boolean supportsCaliper, boolean supportsJUnit, boolean supportsMain) {
48         this.supportsCaliper = supportsCaliper;
49         this.supportsJUnit = supportsJUnit;
50         this.supportsMain = supportsMain;
51     }
52 
supportsCaliper()53     public boolean supportsCaliper() {
54         return supportsCaliper;
55     }
56 
supportsJUnit()57     public boolean supportsJUnit() {
58         return supportsJUnit;
59     }
60 
supportsMain()61     public boolean supportsMain() {
62         return supportsMain;
63     }
64 }
65