• 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 JUnit classes, TestNG classes and classes with a main(String[] args) method.
25      */
26     DEFAULT(false, true, true, true),
27 
28     /**
29      * Runs only Caliper benchmarks.
30      */
31     CALIPER(true, false, false, false),
32 
33     /**
34      * Runs only JUnit classes.
35      */
36     JUNIT(false, true, false, false),
37 
38     /**
39      * Runs only classes with a main(String[] args) method.
40      */
41     MAIN(false, false, true, false),
42 
43     /**
44      * Runs only TestNG classes.
45      */
46     TESTNG(false, false, false, true);
47 
48     private final boolean supportsCaliper;
49     private final boolean supportsJUnit;
50     private final boolean supportsMain;
51     private final boolean supportsTestNg;
52 
RunnerType(boolean supportsCaliper, boolean supportsJUnit, boolean supportsMain, boolean supportsTestNg)53     RunnerType(boolean supportsCaliper, boolean supportsJUnit, boolean supportsMain, boolean supportsTestNg) {
54         this.supportsCaliper = supportsCaliper;
55         this.supportsJUnit = supportsJUnit;
56         this.supportsMain = supportsMain;
57         this.supportsTestNg = supportsTestNg;
58     }
59 
supportsCaliper()60     public boolean supportsCaliper() {
61         return supportsCaliper;
62     }
63 
supportsJUnit()64     public boolean supportsJUnit() {
65         return supportsJUnit;
66     }
67 
supportsMain()68     public boolean supportsMain() {
69         return supportsMain;
70     }
71 
supportsTestNg()72     public boolean supportsTestNg() {
73         return supportsTestNg;
74     }
75 }
76