OLD | NEW |
1 // Copyright 2005, Google Inc. | 1 // Copyright 2005, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // -------------------------- | 114 // -------------------------- |
115 // | 115 // |
116 // Macros indicating the platform on which Google Test is being used | 116 // Macros indicating the platform on which Google Test is being used |
117 // (a macro is defined to 1 if compiled on the given platform; | 117 // (a macro is defined to 1 if compiled on the given platform; |
118 // otherwise UNDEFINED -- it's never defined to 0.). Google Test | 118 // otherwise UNDEFINED -- it's never defined to 0.). Google Test |
119 // defines these macros automatically. Code outside Google Test MUST | 119 // defines these macros automatically. Code outside Google Test MUST |
120 // NOT define them. | 120 // NOT define them. |
121 // | 121 // |
122 // GTEST_OS_AIX - IBM AIX | 122 // GTEST_OS_AIX - IBM AIX |
123 // GTEST_OS_CYGWIN - Cygwin | 123 // GTEST_OS_CYGWIN - Cygwin |
| 124 // GTEST_OS_FREEBSD - FreeBSD |
124 // GTEST_OS_HPUX - HP-UX | 125 // GTEST_OS_HPUX - HP-UX |
125 // GTEST_OS_LINUX - Linux | 126 // GTEST_OS_LINUX - Linux |
126 // GTEST_OS_LINUX_ANDROID - Google Android | 127 // GTEST_OS_LINUX_ANDROID - Google Android |
127 // GTEST_OS_MAC - Mac OS X | 128 // GTEST_OS_MAC - Mac OS X |
128 // GTEST_OS_IOS - iOS | 129 // GTEST_OS_IOS - iOS |
129 // GTEST_OS_NACL - Google Native Client (NaCl) | 130 // GTEST_OS_NACL - Google Native Client (NaCl) |
130 // GTEST_OS_OPENBSD - OpenBSD | 131 // GTEST_OS_OPENBSD - OpenBSD |
131 // GTEST_OS_QNX - QNX | 132 // GTEST_OS_QNX - QNX |
132 // GTEST_OS_SOLARIS - Sun Solaris | 133 // GTEST_OS_SOLARIS - Sun Solaris |
133 // GTEST_OS_SYMBIAN - Symbian | 134 // GTEST_OS_SYMBIAN - Symbian |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 # define GTEST_OS_WINDOWS_DESKTOP 1 | 316 # define GTEST_OS_WINDOWS_DESKTOP 1 |
316 # endif | 317 # endif |
317 # else | 318 # else |
318 # define GTEST_OS_WINDOWS_DESKTOP 1 | 319 # define GTEST_OS_WINDOWS_DESKTOP 1 |
319 # endif // _WIN32_WCE | 320 # endif // _WIN32_WCE |
320 #elif defined __APPLE__ | 321 #elif defined __APPLE__ |
321 # define GTEST_OS_MAC 1 | 322 # define GTEST_OS_MAC 1 |
322 # if TARGET_OS_IPHONE | 323 # if TARGET_OS_IPHONE |
323 # define GTEST_OS_IOS 1 | 324 # define GTEST_OS_IOS 1 |
324 # endif | 325 # endif |
| 326 #elif defined __FreeBSD__ |
| 327 # define GTEST_OS_FREEBSD 1 |
325 #elif defined __linux__ | 328 #elif defined __linux__ |
326 # define GTEST_OS_LINUX 1 | 329 # define GTEST_OS_LINUX 1 |
327 # if defined __ANDROID__ | 330 # if defined __ANDROID__ |
328 # define GTEST_OS_LINUX_ANDROID 1 | 331 # define GTEST_OS_LINUX_ANDROID 1 |
329 # endif | 332 # endif |
330 #elif defined __MVS__ | 333 #elif defined __MVS__ |
331 # define GTEST_OS_ZOS 1 | 334 # define GTEST_OS_ZOS 1 |
332 #elif defined(__sun) && defined(__SVR4) | 335 #elif defined(__sun) && defined(__SVR4) |
333 # define GTEST_OS_SOLARIS 1 | 336 # define GTEST_OS_SOLARIS 1 |
334 #elif defined(_AIX) | 337 #elif defined(_AIX) |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 #endif | 625 #endif |
623 | 626 |
624 // Determines whether Google Test can use the pthreads library. | 627 // Determines whether Google Test can use the pthreads library. |
625 #ifndef GTEST_HAS_PTHREAD | 628 #ifndef GTEST_HAS_PTHREAD |
626 // The user didn't tell us explicitly, so we assume pthreads support is | 629 // The user didn't tell us explicitly, so we assume pthreads support is |
627 // available on Linux and Mac. | 630 // available on Linux and Mac. |
628 // | 631 // |
629 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 | 632 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 |
630 // to your compiler flags. | 633 // to your compiler flags. |
631 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ | 634 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ |
632 || GTEST_OS_QNX) | 635 || GTEST_OS_QNX || GTEST_OS_FREEBSD) |
633 #endif // GTEST_HAS_PTHREAD | 636 #endif // GTEST_HAS_PTHREAD |
634 | 637 |
635 #if GTEST_HAS_PTHREAD | 638 #if GTEST_HAS_PTHREAD |
636 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is | 639 // gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is |
637 // true. | 640 // true. |
638 # include <pthread.h> // NOLINT | 641 # include <pthread.h> // NOLINT |
639 | 642 |
640 // For timespec and nanosleep, used below. | 643 // For timespec and nanosleep, used below. |
641 # include <time.h> // NOLINT | 644 # include <time.h> // NOLINT |
642 #endif | 645 #endif |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 #endif // GTEST_HAS_STREAM_REDIRECTION | 805 #endif // GTEST_HAS_STREAM_REDIRECTION |
803 | 806 |
804 // Determines whether to support death tests. | 807 // Determines whether to support death tests. |
805 // Google Test does not support death tests for VC 7.1 and earlier as | 808 // Google Test does not support death tests for VC 7.1 and earlier as |
806 // abort() in a VC 7.1 application compiled as GUI in debug config | 809 // abort() in a VC 7.1 application compiled as GUI in debug config |
807 // pops up a dialog window that cannot be suppressed programmatically. | 810 // pops up a dialog window that cannot be suppressed programmatically. |
808 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ | 811 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ |
809 (GTEST_OS_MAC && !GTEST_OS_IOS) || \ | 812 (GTEST_OS_MAC && !GTEST_OS_IOS) || \ |
810 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ | 813 (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ |
811 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ | 814 GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ |
812 GTEST_OS_OPENBSD || GTEST_OS_QNX) | 815 GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD) |
813 # define GTEST_HAS_DEATH_TEST 1 | 816 # define GTEST_HAS_DEATH_TEST 1 |
814 # include <vector> // NOLINT | 817 # include <vector> // NOLINT |
815 #endif | 818 #endif |
816 | 819 |
817 // We don't support MSVC 7.1 with exceptions disabled now. Therefore | 820 // We don't support MSVC 7.1 with exceptions disabled now. Therefore |
818 // all the compilers we care about are adequate for supporting | 821 // all the compilers we care about are adequate for supporting |
819 // value-parameterized tests. | 822 // value-parameterized tests. |
820 #define GTEST_HAS_PARAM_TEST 1 | 823 #define GTEST_HAS_PARAM_TEST 1 |
821 | 824 |
822 // Determines whether to support type-driven tests. | 825 // Determines whether to support type-driven tests. |
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 // corresponding to the given Google Test flag. | 2466 // corresponding to the given Google Test flag. |
2464 bool BoolFromGTestEnv(const char* flag, bool default_val); | 2467 bool BoolFromGTestEnv(const char* flag, bool default_val); |
2465 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); | 2468 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); |
2466 const char* StringFromGTestEnv(const char* flag, const char* default_val); | 2469 const char* StringFromGTestEnv(const char* flag, const char* default_val); |
2467 | 2470 |
2468 } // namespace internal | 2471 } // namespace internal |
2469 } // namespace testing | 2472 } // namespace testing |
2470 | 2473 |
2471 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ | 2474 #endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ |
2472 | 2475 |
OLD | NEW |