Primiano Tucci | 919ca1e | 2019-08-21 20:26:58 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 The Android Open Source Project |
| 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 TEST_GTEST_AND_GMOCK_H_ |
| 18 | #define TEST_GTEST_AND_GMOCK_H_ |
| 19 | |
| 20 | // This file is used to proxy the include of gtest/gmock headers and suppress |
| 21 | // the warnings generated by that. |
| 22 | // There are two ways we suppress gtest/gmock warnings: |
| 23 | // 1: Using config("test_warning_suppressions") in BUILD.gn |
| 24 | // 2: Via this file. |
| 25 | // 1 applies recursively also to the test translation units, 2 applies only |
| 26 | // to gmock/gtest includes. |
| 27 | |
Alexander Timin | 597658e | 2021-03-01 14:07:22 +0000 | [diff] [blame] | 28 | #include "perfetto/base/build_config.h" |
| 29 | |
Primiano Tucci | 919ca1e | 2019-08-21 20:26:58 +0200 | [diff] [blame] | 30 | #if defined(__GNUC__) // GCC & clang |
| 31 | #pragma GCC diagnostic push |
| 32 | #pragma GCC diagnostic ignored "-Wundef" |
| 33 | #pragma GCC diagnostic ignored "-Wdeprecated" |
| 34 | #pragma GCC diagnostic ignored "-Wmissing-noreturn" |
| 35 | #pragma GCC diagnostic ignored "-Wsign-conversion" |
Eric Seckler | 063ed39 | 2020-04-03 18:26:30 +0100 | [diff] [blame] | 36 | #pragma GCC diagnostic ignored "-Wfloat-equal" |
Primiano Tucci | 919ca1e | 2019-08-21 20:26:58 +0200 | [diff] [blame] | 37 | #endif // __GNUC__ |
| 38 | |
| 39 | #if defined(__clang__) |
| 40 | #pragma GCC diagnostic ignored "-Wshift-sign-overflow" |
Alexander Timin | 597658e | 2021-03-01 14:07:22 +0000 | [diff] [blame] | 41 | |
| 42 | #if !PERFETTO_BUILDFLAG(PERFETTO_OS_NACL) |
| 43 | // -Wcomma isn't supported on NaCL. |
Primiano Tucci | 919ca1e | 2019-08-21 20:26:58 +0200 | [diff] [blame] | 44 | #pragma GCC diagnostic ignored "-Wcomma" |
Alexander Timin | 597658e | 2021-03-01 14:07:22 +0000 | [diff] [blame] | 45 | #endif // PERFETTO_OS_NACL |
| 46 | |
Primiano Tucci | 919ca1e | 2019-08-21 20:26:58 +0200 | [diff] [blame] | 47 | #endif |
| 48 | |
| 49 | #include <gmock/gmock.h> |
| 50 | #include <gtest/gtest.h> |
| 51 | |
| 52 | #if defined(__GNUC__) |
| 53 | #pragma GCC diagnostic pop |
| 54 | #endif |
| 55 | |
| 56 | #endif // TEST_GTEST_AND_GMOCK_H_ |