blob: 1e5701da44c1f8b749e26d4015c210072a8096d8 [file] [log] [blame]
Damien Martin-Guillerezf88f4d82015-09-25 13:56:55 +00001// Copyright 2014 The Bazel Authors. All rights reserved.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.lib.testutil;
15
Philipp Wollermanna86c9a22015-09-08 17:09:27 +000016import com.google.devtools.build.lib.util.OS;
17
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010018import java.lang.annotation.ElementType;
19import java.lang.annotation.Inherited;
20import java.lang.annotation.Retention;
21import java.lang.annotation.RetentionPolicy;
22import java.lang.annotation.Target;
23
24/**
25 * An annotation class which we use to attach a little meta data to test
26 * classes. For now, we use this to attach a {@link Suite}.
27 */
28@Target(ElementType.TYPE)
29@Retention(RetentionPolicy.RUNTIME)
30@Inherited
31public @interface TestSpec {
32
33 /**
34 * The size of the specified test, in terms of its resource consumption and
35 * execution time.
36 */
37 Suite size() default Suite.SMALL_TESTS;
38
39 /**
40 * The name of the suite to which this test belongs. Useful for creating
41 * test suites organised by function.
42 */
43 String suite() default "";
44
45 /**
Philipp Wollermann3fd49d62015-09-08 16:56:56 +000046 * True, if the test will is not dependable because it has a chance to fail regardless of the
47 * code's correctness. If this is the case, the test should be fixed as soon as possible.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010048 */
49 boolean flaky() default false;
Philipp Wollermannfcf34fd2015-09-08 16:57:53 +000050
51 /**
52 * True, if the test cannot run in a remote execution environment and has to run on the local
53 * machine.
54 */
55 boolean localOnly() default false;
Philipp Wollermanna86c9a22015-09-08 17:09:27 +000056
57 /**
58 * An array of operating systems that the test can run under. If not specified, the test can
59 * run under all operating systems.
60 */
61 OS[] supportedOs() default {};
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010062}