flags/config_test.cc
Go to the documentation of this file.
1 // Copyright 2019 The Abseil Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "absl/flags/config.h"
16 
17 #ifdef __APPLE__
18 #include <TargetConditionals.h>
19 #endif
20 
21 #include "gtest/gtest.h"
22 
23 #ifndef ABSL_FLAGS_STRIP_NAMES
24 #error ABSL_FLAGS_STRIP_NAMES is not defined
25 #endif
26 
27 #ifndef ABSL_FLAGS_STRIP_HELP
28 #error ABSL_FLAGS_STRIP_HELP is not defined
29 #endif
30 
31 namespace {
32 
33 // Test that ABSL_FLAGS_STRIP_NAMES and ABSL_FLAGS_STRIP_HELP are configured how
34 // we expect them to be configured by default. If you override this
35 // configuration, this test will fail, but the code should still be safe to use.
36 TEST(FlagsConfigTest, Test) {
37 #if defined(__ANDROID__)
38  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 1);
39  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 1);
40 #elif defined(__myriad2__)
41  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 0);
42  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 0);
43 #elif defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
44  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 1);
45  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 1);
46 #elif defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED
47  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 1);
48  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 1);
49 #elif defined(__APPLE__)
50  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 0);
51  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 0);
52 #elif defined(_WIN32)
53  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 0);
54  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 0);
55 #elif defined(__linux__)
56  EXPECT_EQ(ABSL_FLAGS_STRIP_NAMES, 0);
57  EXPECT_EQ(ABSL_FLAGS_STRIP_HELP, 0);
58 #endif
59 }
60 
61 } // namespace
#define ABSL_FLAGS_STRIP_HELP
Definition: flags/config.h:45
#define ABSL_FLAGS_STRIP_NAMES
Definition: flags/config.h:40
TEST(Symbolize, Unimplemented)


abseil_cpp
Author(s):
autogenerated on Tue Jun 18 2019 19:44:35