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 com.android.cts.core.runner;
18 
19 import android.support.test.runner.AndroidJUnitRunner;
20 
21 /**
22  * Constants used to communicate to and from {@link AndroidJUnitRunner}.
23  */
24 public interface AndroidJUnitRunnerConstants {
25 
26     /**
27      * The name of the file containing the names of the tests to run.
28      *
29      * <p>This is an internal constant used within
30      * {@code android.support.test.internal.runner.RunnerArgs}, which is used on both the server
31      * and
32      * client side. The constant is used when there are too many test names to pass on the command
33      * line, in which case they are stored in a file that is pushed to the device and then the
34      * location of that file is passed in this argument. The {@code RunnerArgs} on the client will
35      * read the contents of that file in order to retrieve the list of names and then return that
36      * to
37      * its client without the client being aware of how that was done.
38      */
39     String ARGUMENT_TEST_FILE = "testFile";
40 
41     /**
42      * The name of the file containing the names of the tests not to run.
43      *
44      * <p>This is an internal constant used within
45      * {@code android.support.test.internal.runner.RunnerArgs}, which is used on both the server
46      * and
47      * client side. The constant is used when there are too many test names to pass on the command
48      * line, in which case they are stored in a file that is pushed to the device and then the
49      * location of that file is passed in this argument. The {@code RunnerArgs} on the client will
50      * read the contents of that file in order to retrieve the list of names and then return that
51      * to
52      * its client without the client being aware of how that was done.
53      */
54     String ARGUMENT_NOT_TEST_FILE = "notTestFile";
55 
56     /**
57      * A comma separated list of the names of test classes to run.
58      *
59      * <p>The equivalent constant in {@code InstrumentationTestRunner} is hidden and so not
60      * available
61      * through the public API.
62      */
63     String ARGUMENT_TEST_CLASS = "class";
64 
65     /**
66      * A comma separated list of the names of test classes not to run
67      */
68     String ARGUMENT_NOT_TEST_CLASS = "notClass";
69 
70     /**
71      * A comma separated list of the names of test packages to run.
72      *
73      * <p>The equivalent constant in {@code InstrumentationTestRunner} is hidden and so not
74      * available
75      * through the public API.
76      */
77     String ARGUMENT_TEST_PACKAGE = "package";
78 
79     /**
80      * A comma separated list of the names of test packages not to run.
81      */
82     String ARGUMENT_NOT_TEST_PACKAGE = "notPackage";
83 
84     /**
85      * Log the results as if the tests were executed but don't actually run the tests.
86      *
87      * <p>The equivalent constant in {@code InstrumentationTestRunner} is private.
88      */
89     String ARGUMENT_LOG_ONLY = "log";
90 
91     /**
92      * Wait for the debugger before starting.
93      *
94      * <p>There is no equivalent constant in {@code InstrumentationTestRunner} but the string is
95      * used
96      * within that class.
97      */
98     String ARGUMENT_DEBUG = "debug";
99 
100     /**
101      * Only count the number of tests to run.
102      *
103      * <p>There is no equivalent constant in {@code InstrumentationTestRunner} but the string is
104      * used
105      * within that class.
106      */
107     String ARGUMENT_COUNT = "count";
108 
109     /**
110      * The per test timeout value.
111      */
112     String ARGUMENT_TIMEOUT = "timeout_msec";
113 
114     /**
115      * Token representing how long (in seconds) the current test took to execute.
116      *
117      * <p>The equivalent constant in {@code InstrumentationTestRunner} is private.
118      */
119     String REPORT_KEY_RUNTIME = "runtime";
120 
121     /**
122      * An identifier for tests run using this class.
123      */
124     String REPORT_VALUE_ID = "CoreTestRunner";
125 }
126