Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: ios/testing/earl_grey/disabled_test_macros.h

Issue 2224313003: Add macro for consistent logging when disabling tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo! Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/testing/earl_grey/BUILD.gn ('k') | ios/testing/earl_grey/earl_grey_support.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/testing/earl_grey/disabled_test_macros.h
diff --git a/ios/testing/earl_grey/disabled_test_macros.h b/ios/testing/earl_grey/disabled_test_macros.h
new file mode 100644
index 0000000000000000000000000000000000000000..5adb429f37c424a9e2d1b3acf2f9ca39b2cdcd4a
--- /dev/null
+++ b/ios/testing/earl_grey/disabled_test_macros.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_
+#define IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_
+
+// A macro that forces an Earl Grey test to pass. It should be used to disable
+// tests that fail due to a bug. This macro should be used when the
+// configuration for which the test should be disabled can only be determined
+// at runtime. Disabling at compile-time is always preferred.
+// Example:
+// - (void)testFoo
+// if (base::ios::IsRunningOnIOS10OrLater()) {
+// EARL_GREY_TEST_DISABLED(@"Disabled on iOS 10.");
+// }
+#define EARL_GREY_TEST_DISABLED(message) \
+ while (true) { \
+ NSLog(@"-- Earl Grey Test Disabled -- %@", message); \
+ return; \
+ }
+
+// A macro that forces an Earl Grey test to pass. This should be used when a
+// test fails for a specific configuration because it is not supported, but
+// there is no error. This macro should only be used when the configuration for
+// which the test should be disabled can only be determined at runtime.
+// Disabling at compile-time is always preferred.
+// Example:
+// - (void)testFoo
+// if (base::ios::IsRunningOnIOS10OrLater()) {
+// EARL_GREY_TEST_SKIPPED(@"Test not supported on iOS 10.");
+// }
+#define EARL_GREY_TEST_SKIPPED(message) \
+ while (true) { \
+ NSLog(@"-- Earl Grey Test Skipped -- %@", message); \
+ return; \
+ }
+
+#endif // IOS_TESTING_EARL_GREY_DISABLED_TEST_MACROS_H_
« no previous file with comments | « ios/testing/earl_grey/BUILD.gn ('k') | ios/testing/earl_grey/earl_grey_support.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698