blob: fdc56acc05b212f3c30430ac80c4f484b3238c8c [file] [log] [blame]
phoglund@webrtc.orgd0054682013-01-09 16:53:42 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10#ifndef TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_
11#define TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_
12
13// Helper macros for platform disables. These can be chained. Example use:
14// TEST_F(ViEStandardIntegrationTest,
15// DISABLED_ON_LINUX(RunsBaseTestWithoutErrors)) { // ...
16//
17// Or, you can disable a whole test class by wrapping all mentions of the test
18// class name inside one of these macros.
19//
20// The platform #defines we are looking at here are set by the build system.
21#ifdef WEBRTC_LINUX
22#define DISABLED_ON_LINUX(test) DISABLED_##test
23#else
24#define DISABLED_ON_LINUX(test) test
25#endif
26
27#ifdef WEBRTC_MAC
28#define DISABLED_ON_MAC(test) DISABLED_##test
29#else
30#define DISABLED_ON_MAC(test) test
31#endif
32
33#ifdef _WIN32
34#define DISABLED_ON_WIN(test) DISABLED_##test
35#else
36#define DISABLED_ON_WIN(test) test
37#endif
38
henrikaa2c79402015-06-10 13:24:48 +020039// Using some extra magic here to be able to chain Android and iOS macros.
40// http://stackoverflow.com/questions/8231966/why-do-i-need-double-layer-of-indirection-for-macros
henrike@webrtc.orga950300b2013-07-08 18:53:54 +000041#ifdef WEBRTC_ANDROID
henrikaa2c79402015-06-10 13:24:48 +020042#define DISABLED_ON_ANDROID_HIDDEN(test) DISABLED_##test
43#define DISABLED_ON_ANDROID(test) DISABLED_ON_ANDROID_HIDDEN(test)
henrike@webrtc.orga950300b2013-07-08 18:53:54 +000044#else
henrikaa2c79402015-06-10 13:24:48 +020045#define DISABLED_ON_ANDROID_HIDDEN(test) test
46#define DISABLED_ON_ANDROID(test) DISABLED_ON_ANDROID_HIDDEN(test)
47#endif
48
49#ifdef WEBRTC_IOS
50#define DISABLED_ON_IOS_HIDDEN(test) DISABLED_##test
51#define DISABLED_ON_IOS(test) DISABLED_ON_IOS_HIDDEN(test)
52#else
53#define DISABLED_ON_IOS_HIDDEN(test) test
54#define DISABLED_ON_IOS(test) DISABLED_ON_IOS_HIDDEN(test)
henrike@webrtc.orga950300b2013-07-08 18:53:54 +000055#endif
56
phoglund@webrtc.orgd0054682013-01-09 16:53:42 +000057#endif // TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_