Damien Martin-Guillerez | f88f4d8 | 2015-09-25 13:56:55 +0000 | [diff] [blame] | 1 | // Copyright 2014 The Bazel Authors. All rights reserved. |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 2 | // |
| 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. |
| 14 | package com.google.devtools.build.lib.testutil; |
| 15 | |
Philipp Wollermann | a86c9a2 | 2015-09-08 17:09:27 +0000 | [diff] [blame] | 16 | import com.google.devtools.build.lib.util.OS; |
| 17 | |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 18 | import java.lang.annotation.ElementType; |
| 19 | import java.lang.annotation.Inherited; |
| 20 | import java.lang.annotation.Retention; |
| 21 | import java.lang.annotation.RetentionPolicy; |
| 22 | import 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 |
| 31 | public @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 Wollermann | 3fd49d6 | 2015-09-08 16:56:56 +0000 | [diff] [blame] | 46 | * 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 Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 48 | */ |
| 49 | boolean flaky() default false; |
Philipp Wollermann | fcf34fd | 2015-09-08 16:57:53 +0000 | [diff] [blame] | 50 | |
| 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 Wollermann | a86c9a2 | 2015-09-08 17:09:27 +0000 | [diff] [blame] | 56 | |
| 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 Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 62 | } |