Flutter Engine
MacUtils.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MAC_UTILS_H
18 #define MAC_UTILS_H
19 
20 #if defined(__APPLE__)
21 #define DISABLE_TEST_MAC(TEST_NAME) DISABLED_##TEST_NAME
22 #define FRIEND_TEST_MAC_DISABLED_EXPANDED(SUITE, TEST_NAME) \
23  FRIEND_TEST(SUITE, TEST_NAME)
24 #define FRIEND_TEST_MAC_DISABLED(SUITE, TEST_NAME) \
25  FRIEND_TEST_MAC_DISABLED_EXPANDED(SUITE, DISABLE_TEST_MAC(TEST_NAME))
26 
27 #define FRIEND_TEST_MAC_ONLY(SUITE, TEST_NAME) FRIEND_TEST(SUITE, TEST_NAME)
28 #define MAC_ONLY(TEST_NAME) TEST_NAME
29 
30 #else
31 #define DISABLE_TEST_MAC(TEST_NAME) TEST_NAME
32 #define FRIEND_TEST_MAC_DISABLED(SUITE, TEST_NAME) FRIEND_TEST(SUITE, TEST_NAME)
33 
34 #define MAC_ONLY(TEST_NAME) DISABLED_##TEST_NAME
35 #define FRIEND_TEST_MAC_ONLY_EXPANDED(SUITE, TEST_NAME) \
36  FRIEND_TEST(SUITE, TEST_NAME)
37 #define FRIEND_TEST_MAC_ONLY(SUITE, TEST_NAME) \
38  FRIEND_TEST_MAC_ONLY_EXPANDED(SUITE, DISABLE_TEST_MAC(TEST_NAME))
39 #endif // defined(__APPLE__)
40 #endif // MAC_UTILS_H