Flutter Engine
LinuxUtils.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 LINUX_UTILS_H
18 #define LINUX_UTILS_H
19 
20 #if defined(__linux__)
21 #define DISABLE_TEST_LINUX(TEST_NAME) TEST_NAME
22 #define FRIEND_TEST_LINUX_DISABLED_EXPANDED(SUITE, TEST_NAME) \
23  FRIEND_TEST(SUITE, TEST_NAME)
24 #define FRIEND_TEST_LINUX_DISABLED(SUITE, TEST_NAME) \
25  FRIEND_TEST_LINUX_DISABLED_EXPANDED(SUITE, DISABLE_TEST_LINUX(TEST_NAME))
26 
27 #define FRIEND_TEST_LINUX_ONLY(SUITE, TEST_NAME) FRIEND_TEST(SUITE, TEST_NAME)
28 #define LINUX_ONLY(TEST_NAME) TEST_NAME
29 
30 #else
31 #define DISABLE_TEST_LINUX(TEST_NAME) DISABLED_##TEST_NAME
32 #define FRIEND_TEST_LINUX_DISABLED(SUITE, TEST_NAME) \
33  FRIEND_TEST(SUITE, TEST_NAME)
34 
35 #define LINUX_ONLY(TEST_NAME) DISABLED_##TEST_NAME
36 #define FRIEND_TEST_LINUX_ONLY_EXPANDED(SUITE, TEST_NAME) \
37  FRIEND_TEST(SUITE, TEST_NAME)
38 #define FRIEND_TEST_LINUX_ONLY(SUITE, TEST_NAME) \
39  FRIEND_TEST_LINUX_ONLY_EXPANDED(SUITE, DISABLE_TEST_LINUX(TEST_NAME))
40 #endif // defined(__linux__)
41 
42 #endif // LINUX_UTILS_H