OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_ |
| 6 #define IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_ |
| 7 |
| 8 // A macro that forces an Earl Grey test to pass. It should be used to disable |
| 9 // tests that fail due to a bug. This macro should be used when the |
| 10 // configuration for which the test should be disabled can only be determined |
| 11 // at runtime. Disabling at compile-time is always preferred. |
| 12 // Example: |
| 13 // - (void)testFoo |
| 14 // if (base::ios::IsRunningOnIOS10OrLater()) { |
| 15 // EARL_GREY_TEST_DISABLED(@"Disabled on iOS 10."); |
| 16 // } |
| 17 #define EARL_GREY_TEST_DISABLED(message) \ |
| 18 while (true) { \ |
| 19 NSLog(@"-- Earl Grey Test Disabled -- %@", message); \ |
| 20 return; \ |
| 21 } |
| 22 |
| 23 // A macro that forces an Earl Grey test to pass. This should be used when a |
| 24 // test fails for a specific configuration because it is not supported, but |
| 25 // there is no error. This macro should only be used when the configuration for |
| 26 // which the test should be disabled can only be determined at runtime. |
| 27 // Disabling at compile-time is always preferred. |
| 28 // Example: |
| 29 // - (void)testFoo |
| 30 // if (base::ios::IsRunningOnIOS10OrLater()) { |
| 31 // EARL_GREY_TEST_SKIPPED(@"Test not supported on iOS 10."); |
| 32 // } |
| 33 #define EARL_GREY_TEST_SKIPPED(message) \ |
| 34 while (true) { \ |
| 35 NSLog(@"-- Earl Grey Test Skipped -- %@", message); \ |
| 36 return; \ |
| 37 } |
| 38 |
| 39 #endif // IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_ |
OLD | NEW |