diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-21 19:17:34 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-22 18:10:08 +0300 |
commit | 161393805f606089959f04b7656bd33b9b91311f (patch) | |
tree | 945863eb60b5a4702204cd065d4bf0fcf489b392 /extern/gtest | |
parent | cfe43f8d1af2183a115414abd56a899d116be27d (diff) |
Update Google libraries
This commit updates:
- gflags 2.2.0 -> 2.2.1
- glog 0.3.4 -> 0.3.4
- gmock 1.7.0 -> 1.8.0
- gtest 1.7.0 -> 1.8.0
Diffstat (limited to 'extern/gtest')
-rw-r--r-- | extern/gtest/README.blender | 2 | ||||
-rw-r--r-- | extern/gtest/README.md | 138 | ||||
-rw-r--r-- | extern/gtest/include/gtest/gtest-printers.h | 8 | ||||
-rw-r--r-- | extern/gtest/include/gtest/gtest.h | 18 | ||||
-rw-r--r-- | extern/gtest/include/gtest/internal/gtest-internal.h | 8 | ||||
-rw-r--r-- | extern/gtest/include/gtest/internal/gtest-port.h | 57 |
6 files changed, 164 insertions, 67 deletions
diff --git a/extern/gtest/README.blender b/extern/gtest/README.blender index 41dda92c19c..6165bd6f717 100644 --- a/extern/gtest/README.blender +++ b/extern/gtest/README.blender @@ -1,7 +1,7 @@ Project: Google C++ Testing Framework URL: https://github.com/google/googletest License: New BSD -Upstream version: 1.7.0 (ec44c6c) +Upstream version: 1.8.0 (ec44c6c1675) Local modifications: None. diff --git a/extern/gtest/README.md b/extern/gtest/README.md new file mode 100644 index 00000000000..22df99bd4b0 --- /dev/null +++ b/extern/gtest/README.md @@ -0,0 +1,138 @@ + +# Google Test # + +[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest) + +Welcome to **Google Test**, Google's C++ test framework! + +This repository is a merger of the formerly separate GoogleTest and +GoogleMock projects. These were so closely related that it makes sense to +maintain and release them together. + +Please see the project page above for more information as well as the +mailing list for questions, discussions, and development. There is +also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please +join us! + +**Google Mock** is an extension to Google Test for writing and using C++ mock +classes. See the separate [Google Mock documentation](googlemock/README.md). + +More detailed documentation for googletest (including build instructions) are +in its interior [googletest/README.md](googletest/README.md) file. + +## Features ## + + * An [XUnit](https://en.wikipedia.org/wiki/XUnit) test framework. + * Test discovery. + * A rich set of assertions. + * User-defined assertions. + * Death tests. + * Fatal and non-fatal failures. + * Value-parameterized tests. + * Type-parameterized tests. + * Various options for running the tests. + * XML test report generation. + +## Platforms ## + +Google test has been used on a variety of platforms: + + * Linux + * Mac OS X + * Windows + * Cygwin + * MinGW + * Windows Mobile + * Symbian + +## Who Is Using Google Test? ## + +In addition to many internal projects at Google, Google Test is also used by +the following notable projects: + + * The [Chromium projects](http://www.chromium.org/) (behind the Chrome + browser and Chrome OS). + * The [LLVM](http://llvm.org/) compiler. + * [Protocol Buffers](https://github.com/google/protobuf), Google's data + interchange format. + * The [OpenCV](http://opencv.org/) computer vision library. + +## Related Open Source Projects ## + +[Google Test UI](https://github.com/ospector/gtest-gbar) is test runner that runs +your test binary, allows you to track its progress via a progress bar, and +displays a list of test failures. Clicking on one shows failure text. Google +Test UI is written in C#. + +[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event +listener for Google Test that implements the +[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test +result output. If your test runner understands TAP, you may find it useful. + +## Requirements ## + +Google Test is designed to have fairly minimal requirements to build +and use with your projects, but there are some. Currently, we support +Linux, Windows, Mac OS X, and Cygwin. We will also make our best +effort to support other platforms (e.g. Solaris, AIX, and z/OS). +However, since core members of the Google Test project have no access +to these platforms, Google Test may have outstanding issues there. If +you notice any problems on your platform, please notify +<googletestframework@googlegroups.com>. Patches for fixing them are +even more welcome! + +### Linux Requirements ### + +These are the base requirements to build and use Google Test from a source +package (as described below): + + * GNU-compatible Make or gmake + * POSIX-standard shell + * POSIX(-2) Regular Expressions (regex.h) + * A C++98-standard-compliant compiler + +### Windows Requirements ### + + * Microsoft Visual C++ v7.1 or newer + +### Cygwin Requirements ### + + * Cygwin v1.5.25-14 or newer + +### Mac OS X Requirements ### + + * Mac OS X v10.4 Tiger or newer + * XCode Developer Tools + +### Requirements for Contributors ### + +We welcome patches. If you plan to contribute a patch, you need to +build Google Test and its own tests from a git checkout (described +below), which has further requirements: + + * [Python](https://www.python.org/) v2.3 or newer (for running some of + the tests and re-generating certain source files from templates) + * [CMake](https://cmake.org/) v2.6.4 or newer + +## Regenerating Source Files ## + +Some of Google Test's source files are generated from templates (not +in the C++ sense) using a script. +For example, the +file include/gtest/internal/gtest-type-util.h.pump is used to generate +gtest-type-util.h in the same directory. + +You don't need to worry about regenerating the source files +unless you need to modify them. You would then modify the +corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)' +generator script. See the [Pump Manual](googletest/docs/PumpManual.md). + +### Contributing Code ### + +We welcome patches. Please read the +[Developer's Guide](googletest/docs/DevGuide.md) +for how you can contribute. In particular, make sure you have signed +the Contributor License Agreement, or we won't be able to accept the +patch. + +Happy testing! diff --git a/extern/gtest/include/gtest/gtest-printers.h b/extern/gtest/include/gtest/gtest-printers.h index 27a1edc3728..8a33164cb38 100644 --- a/extern/gtest/include/gtest/gtest-printers.h +++ b/extern/gtest/include/gtest/gtest-printers.h @@ -103,7 +103,7 @@ #include "gtest/internal/gtest-port.h" #include "gtest/internal/gtest-internal.h" -#if defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_ +#if GTEST_HAS_STD_TUPLE_ # include <tuple> #endif @@ -581,7 +581,7 @@ inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { } #endif // GTEST_HAS_STD_WSTRING -#if GTEST_HAS_TR1_TUPLE || (defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_) +#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_ // Helper function for printing a tuple. T must be instantiated with // a tuple type. template <typename T> @@ -664,7 +664,7 @@ void PrintTo( } #endif // GTEST_HAS_TR1_TUPLE -#if defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_ +#if GTEST_HAS_STD_TUPLE_ template <typename... Types> void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) { PrintTupleTo(t, os); @@ -888,7 +888,7 @@ template <typename TupleT> const size_t TuplePolicy<TupleT>::tuple_size; #endif // GTEST_HAS_TR1_TUPLE -#if defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_ +#if GTEST_HAS_STD_TUPLE_ template <typename... Types> struct TuplePolicy< ::std::tuple<Types...> > { typedef ::std::tuple<Types...> Tuple; diff --git a/extern/gtest/include/gtest/gtest.h b/extern/gtest/include/gtest/gtest.h index 18d3ed4b469..f846c5bd669 100644 --- a/extern/gtest/include/gtest/gtest.h +++ b/extern/gtest/include/gtest/gtest.h @@ -1818,7 +1818,7 @@ class TestWithParam : public Test, public WithParamInterface<T> { // Define this macro to 1 to omit the definition of FAIL(), which is a // generic name and clashes with some other libraries. -#if !defined(GTEST_DONT_DEFINE_FAIL) || !GTEST_DONT_DEFINE_FAIL +#if !GTEST_DONT_DEFINE_FAIL # define FAIL() GTEST_FAIL() #endif @@ -1827,7 +1827,7 @@ class TestWithParam : public Test, public WithParamInterface<T> { // Define this macro to 1 to omit the definition of SUCCEED(), which // is a generic name and clashes with some other libraries. -#if !defined(GTEST_DONT_DEFINE_SUCCEED) || !GTEST_DONT_DEFINE_SUCCEED +#if !GTEST_DONT_DEFINE_SUCCEED # define SUCCEED() GTEST_SUCCEED() #endif @@ -1952,27 +1952,27 @@ class TestWithParam : public Test, public WithParamInterface<T> { // Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of // ASSERT_XY(), which clashes with some users' own code. -#if !defined(GTEST_DONT_DEFINE_ASSERT_EQ) || !GTEST_DONT_DEFINE_ASSERT_EQ +#if !GTEST_DONT_DEFINE_ASSERT_EQ # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) #endif -#if !defined(GTEST_DONT_DEFINE_ASSERT_NE) || !GTEST_DONT_DEFINE_ASSERT_NE +#if !GTEST_DONT_DEFINE_ASSERT_NE # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) #endif -#if !defined(GTEST_DONT_DEFINE_ASSERT_LE) || !GTEST_DONT_DEFINE_ASSERT_LE +#if !GTEST_DONT_DEFINE_ASSERT_LE # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) #endif -#if !defined(GTEST_DONT_DEFINE_ASSERT_LT) || !GTEST_DONT_DEFINE_ASSERT_LT +#if !GTEST_DONT_DEFINE_ASSERT_LT # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) #endif -#if !defined(GTEST_DONT_DEFINE_ASSERT_GE) || !GTEST_DONT_DEFINE_ASSERT_GE +#if !GTEST_DONT_DEFINE_ASSERT_GE # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) #endif -#if !defined(GTEST_DONT_DEFINE_ASSERT_GT) || !GTEST_DONT_DEFINE_ASSERT_GT +#if !GTEST_DONT_DEFINE_ASSERT_GT # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) #endif @@ -2183,7 +2183,7 @@ bool StaticAssertTypeEq() { // Define this macro to 1 to omit the definition of TEST(), which // is a generic name and clashes with some other libraries. -#if !defined(GTEST_DONT_DEFINE_TEST) || !GTEST_DONT_DEFINE_TEST +#if !GTEST_DONT_DEFINE_TEST # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) #endif diff --git a/extern/gtest/include/gtest/internal/gtest-internal.h b/extern/gtest/include/gtest/internal/gtest-internal.h index ca15a2f3a78..ebd1cf615de 100644 --- a/extern/gtest/include/gtest/internal/gtest-internal.h +++ b/extern/gtest/include/gtest/internal/gtest-internal.h @@ -60,10 +60,6 @@ #include <string> #include <vector> -#if (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) -# include <type_traits> -#endif - #include "gtest/gtest-message.h" #include "gtest/internal/gtest-string.h" #include "gtest/internal/gtest-filepath.h" @@ -858,7 +854,6 @@ struct AddReference<T&> { typedef T& type; }; // NOLINT template <typename From, typename To> class ImplicitlyConvertible { private: -#if !((__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800)) // We need the following helper functions only for their types. // They have no implementations. @@ -879,7 +874,6 @@ class ImplicitlyConvertible { // implicitly converted to type To. static char Helper(To); static char (&Helper(...))[2]; // NOLINT -#endif // We have to put the 'public' section after the 'private' section, // or MSVC refuses to compile the code. @@ -889,8 +883,6 @@ class ImplicitlyConvertible { // instantiation. The simplest workaround is to use its C++0x type traits // functions (C++Builder 2009 and above only). static const bool value = __is_convertible(From, To); -#elif (__cplusplus > 199711L) || (defined(_MSC_VER) && _MSC_VER >= 1800) - static const bool value = std::is_convertible<From, To>::value; #else // MSVC warns about implicitly converting from double to int for // possible loss of data, so we need to temporarily disable the diff --git a/extern/gtest/include/gtest/internal/gtest-port.h b/extern/gtest/include/gtest/internal/gtest-port.h index ad2a43df17d..0094ed5077e 100644 --- a/extern/gtest/include/gtest/internal/gtest-port.h +++ b/extern/gtest/include/gtest/internal/gtest-port.h @@ -306,7 +306,7 @@ // GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385) // /* code that triggers warnings C4800 and C4385 */ // GTEST_DISABLE_MSC_WARNINGS_POP_() -#if defined(_MSC_VER) && _MSC_VER >= 1500 +#if _MSC_VER >= 1500 # define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \ __pragma(warning(push)) \ __pragma(warning(disable: warnings)) @@ -323,7 +323,7 @@ // -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a // value for __cplusplus, and recent versions of clang, gcc, and // probably other compilers set that too in C++11 mode. -# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L +# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L // Compiling in at least C++11 mode. # define GTEST_LANG_CXX11 1 # else @@ -352,7 +352,7 @@ #endif // Only use C++11 library features if the library provides them. -#if defined(GTEST_STDLIB_CXX11) && GTEST_STDLIB_CXX11 +#if GTEST_STDLIB_CXX11 # define GTEST_HAS_STD_BEGIN_AND_END_ 1 # define GTEST_HAS_STD_FORWARD_LIST_ 1 # define GTEST_HAS_STD_FUNCTION_ 1 @@ -387,37 +387,6 @@ # endif #endif -#ifndef GTEST_OS_WINDOWS -# define GTEST_OS_WINDOWS 0 -#endif -#ifndef GTEST_OS_WINDOWS_MINGW -# define GTEST_OS_WINDOWS_MINGW 0 -#endif -#ifndef GTEST_OS_WINDOWS_PHONE -# define GTEST_OS_WINDOWS_PHONE 0 -#endif -#ifndef GTEST_OS_WINDOWS_MOBILE -# define GTEST_OS_WINDOWS_MOBILE 0 -#endif -#ifndef GTEST_OS_WINDOWS_RT -# define GTEST_OS_WINDOWS_RT 0 -#endif -#ifndef GTEST_OS_LINUX_ANDROID -# define GTEST_OS_LINUX_ANDROID 0 -#endif -#ifndef GTEST_OS_QNX -# define GTEST_OS_QNX 0 -#endif -#ifndef GTEST_OS_SYMBIAN -# define GTEST_OS_SYMBIAN 0 -#endif -#ifndef GTEST_OS_CYGWIN -# define GTEST_OS_CYGWIN 0 -#endif -#ifndef GTEST_OS_SOLARIS -# define GTEST_OS_SOLARIS 0 -#endif - // Brings in definitions for functions used in the testing::internal::posix // namespace (read, write, close, chdir, isatty, stat). We do not currently // use them on Windows Mobile. @@ -454,7 +423,7 @@ struct _RTL_CRITICAL_SECTION; # endif #endif -#if defined(GTEST_USES_PCRE) && GTEST_USES_PCRE +#if GTEST_USES_PCRE // The appropriate headers have already been included. #elif GTEST_HAS_POSIX_RE @@ -647,7 +616,7 @@ struct _RTL_CRITICAL_SECTION; // Determines if hash_map/hash_set are available. // Only used for testing against those containers. #if !defined(GTEST_HAS_HASH_MAP_) -# if defined(_MSC_VER) +# if _MSC_VER # define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available. # define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available. # endif // _MSC_VER @@ -691,8 +660,6 @@ struct _RTL_CRITICAL_SECTION; // can build with clang but need to use gcc4.2's libstdc++). # if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) # define GTEST_ENV_HAS_STD_TUPLE_ 1 -# else -# define GTEST_ENV_HAS_STD_TUPLE_ 0 # endif # if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ @@ -706,7 +673,7 @@ struct _RTL_CRITICAL_SECTION; // To avoid conditional compilation everywhere, we make it // gtest-port.h's responsibility to #include the header implementing // tuple. -#if defined(GTEST_HAS_STD_TUPLE_) && GTEST_HAS_STD_TUPLE_ +#if GTEST_HAS_STD_TUPLE_ # include <tuple> // IWYU pragma: export # define GTEST_TUPLE_NAMESPACE_ ::std #endif // GTEST_HAS_STD_TUPLE_ @@ -947,7 +914,7 @@ using ::std::tuple_size; # endif #define GTEST_IS_THREADSAFE \ - ((defined(GTEST_HAS_MUTEX_AND_THREAD_LOCAL_) && GTEST_HAS_MUTEX_AND_THREAD_LOCAL_) \ + (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \ || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \ || GTEST_HAS_PTHREAD) @@ -1343,7 +1310,7 @@ inline void FlushInfoLog() { fflush(NULL); } GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ << gtest_error -#if defined(GTEST_HAS_STD_MOVE_) && GTEST_HAS_STD_MOVE_ +#if GTEST_HAS_STD_MOVE_ using std::move; #else // GTEST_HAS_STD_MOVE_ template <typename T> @@ -1427,7 +1394,7 @@ Derived* CheckedDowncastToActualType(Base* base) { GTEST_CHECK_(typeid(*base) == typeid(Derived)); #endif -#if defined(GTEST_HAS_DOWNCAST_) && GTEST_HAS_DOWNCAST_ +#if GTEST_HAS_DOWNCAST_ return ::down_cast<Derived*>(base); #elif GTEST_HAS_RTTI return dynamic_cast<Derived*>(base); // NOLINT @@ -1487,7 +1454,7 @@ inline void SleepMilliseconds(int n) { } # endif // GTEST_HAS_PTHREAD -# if defined(GTEST_HAS_NOTIFICATION_) && GTEST_HAS_NOTIFICATION_ +# if GTEST_HAS_NOTIFICATION_ // Notification has already been imported into the namespace. // Nothing to do here. @@ -1670,7 +1637,7 @@ class ThreadWithParam : public ThreadWithParamBase { # endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD || // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ -# if defined(GTEST_HAS_MUTEX_AND_THREAD_LOCAL_) && GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ +# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ // Mutex and ThreadLocal have already been imported into the namespace. // Nothing to do here. @@ -2450,7 +2417,7 @@ inline void Abort() { abort(); } // MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate // function in order to achieve that. We use macro definition here because // snprintf is a variadic function. -#if defined(_MSC_VER) && _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE +#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE // MSVC 2005 and above support variadic macros. # define GTEST_SNPRINTF_(buffer, size, format, ...) \ _snprintf_s(buffer, size, size, format, __VA_ARGS__) |