Compare commits

..
Author SHA1 Message Date
shiqian 190fa6300b Creates tags/release-1.1.0 from the head of branches/release-1.1. 2008-09-19 00:16:53 +00:00
shiqian e79c3ccb73 Makes the Python tests more portable by calling standard functions to interpret the result of os.system(). This could fix the broken Python tests on some users' machines. 2008-09-18 21:18:11 +00:00
shiqian f6b0dc0b40 Makes Google Test compile (and all tests pass) on cygwin (possibly on wingw too). 2008-09-18 18:06:35 +00:00
shiqian 9e672bd5e3 Prepares gtest for release 1.1.0. 2008-09-16 23:48:19 +00:00
shiqian ee39a89deb Adds suffix 'd' to gtest's libs on Windows. Also fixes gtest_unittest on non-English Windows. By balazs.dan@gmail.com. 2008-09-13 00:49:59 +00:00
shiqian 36865d8d35 Adds exception assertions. By balaz.dan@gmail.com. 2008-09-12 20:57:22 +00:00
preston.jackson 0bbdb14f74 adding two headers to the Xcode project 2008-09-12 15:23:38 +00:00
shiqian 019d19af97 Improves thread-safe death tests by changing to the original working directory before they are executed; also fixes out-dated comments about death tests. 2008-09-12 04:01:37 +00:00
shiqian 29d8235540 Adds new files for type-parameterized tests, which I forgot to commit in the previous revision. 2008-09-09 03:01:38 +00:00
shiqian a2b1a8556e Adds support for type-parameterized tests (by Zhanyong Wan); also adds case-insensitive wide string comparison to the String class (by Vlad Losev). 2008-09-08 17:55:52 +00:00
vladlosev 0c5a66245b Implement wide->UTF-8 string conversion more correctly 2008-08-25 23:11:54 +00:00
shiqian c6e674dbb3 Adds a sample on using Google Test as a Mac framework. By Preston Jackson. 2008-08-20 17:43:12 +00:00
shiqian d5f13d4a25 Changes test creation functions to factories. By Vlad Losev. 2008-08-06 21:44:19 +00:00
shiqian 9b093c1779 Cleans up the usage of testing:: in gtest_unittest. By Zhanyong Wan. 2008-08-06 21:43:15 +00:00
shiqian dfcf6eba0f Adds Xcode's version requirement to README. By Preston Jackson. 2008-08-06 21:42:12 +00:00
shiqian bcb12fa0f6 Fixes the definition of GTEST_ATTRIBUTE_UNUSED and make the tests pass in opt mode. 2008-08-01 19:04:48 +00:00
shiqian bf9b4b48dc Makes gtest work on Windows Mobile and Symbian. By Mika Raento. 2008-07-31 18:34:08 +00:00
shiqian dc6ee0e36d Makes death tests create temporary files in /tmp instead of the current folder. 2008-07-29 23:15:28 +00:00
shiqian d88da49d02 Adds a test for the GTEST_PRINT_TIME env var. By Balazs.Dan@gmail.com. 2008-07-25 21:13:11 +00:00
shiqian 15cbe5f70a Adds --gtest_print_test for printing the elapsed time of tests. 2008-07-25 04:06:16 +00:00
shiqian dbc56bf84b Adds an Xcode project for building gtest. By Preston Jackson. 2008-07-25 00:54:56 +00:00
shiqian 253d2bc576 Makes the output understandable by VS when compiled by MSVC. 2008-07-23 20:32:11 +00:00
shiqian b758726396 Fixes some style nits; also fixes minor bugs in gtest-death-test.cc. 2008-07-23 20:28:27 +00:00
vladlosev 57b43f2775 Fix incorrect output file name in gtest_main.vcproj 2008-07-15 00:25:58 +00:00
shiqian c67d1a2ae8 Fixes instructions for building on Mac OS X. 2008-07-11 20:01:35 +00:00
shiqian 8bbeac4c24 Updates the release version to 1.0.1. 2008-07-09 21:53:05 +00:00
shiqian e0ecb7ac58 Makes Google Test compile on Mac OS X and Cygwin, and adds project files for Microsoft Visual Studio. 2008-07-09 20:58:26 +00:00
shiqian e4e9a8bd7d Makes the autotools scripts work on Mac OS X. Also hopefully makes gtest compile on Windows CE. 2008-07-08 21:32:17 +00:00
65 changed files with 10469 additions and 779 deletions
+16
View File
@@ -1,3 +1,19 @@
Changes for 1.1.0:
* New feature: type-parameterized tests.
* New feature: exception assertions.
* New feature: printing elapsed time of tests.
* Improved the robustness of death tests.
* Added an Xcode project and samples.
* Adjusted the output format on Windows to be understandable by Visual Studio.
* Minor bug fixes.
Changes for 1.0.1:
* Added project files for Visual Studio 7.1.
* Fixed issues with compiling on Mac OS X.
* Fixed issues with compiling on Cygwin.
Changes for 1.0.0:
* Initial Open Source release of Google Test
+3
View File
@@ -4,6 +4,7 @@
# here. Please keep the list sorted by first names.
Ajay Joshi <jaj@google.com>
Balázs Dán <balazs.dan@gmail.com>
Bharat Mediratta <bharat@menalto.com>
Chandler Carruth <chandlerc@google.com>
Chris Prince <cprince@google.com>
@@ -17,9 +18,11 @@ Mika Raento <mikie@iki.fi>
Patrick Hanna <phanna@google.com>
Patrick Riley <pfr@google.com>
Peter Kaminski <piotrk@google.com>
Preston Jackson <preston.jackson@gmail.com>
Russ Cox <rsc@google.com>
Russ Rufer <russ@pentad.com>
Sean Mcafee <eefacm@gmail.com>
Sigurður Ásgeirsson <siggi@google.com>
Tracy Bialik <tracy@pentad.com>
Vlad Losev <vladl@google.com>
Zhanyong Wan <wan@google.com>
+53 -3
View File
@@ -1,11 +1,45 @@
# Automake file
# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.
# Nonstandard package files for distribution
EXTRA_DIST = \
CHANGES \
CONTRIBUTORS \
include/gtest/internal/gtest-type-util.h.pump \
scripts/gen_gtest_pred_impl.py
# MSVC project files
EXTRA_DIST += \
msvc/gtest.sln \
msvc/gtest.vcproj \
msvc/gtest_color_test_.vcproj \
msvc/gtest_env_var_test_.vcproj \
msvc/gtest_environment_test.vcproj \
msvc/gtest_main.vcproj \
msvc/gtest_output_test_.vcproj \
msvc/gtest_prod_test.vcproj \
msvc/gtest_uninitialized_test_.vcproj \
msvc/gtest_unittest.vcproj
# xcode project files
EXTRA_DIST += \
xcode/Config/DebugProject.xcconfig \
xcode/Config/FrameworkTarget.xcconfig \
xcode/Config/General.xcconfig \
xcode/Config/ReleaseProject.xcconfig \
xcode/Resources/Info.plist \
xcode/Scripts/versiongenerate.py \
xcode/gtest.xcodeproj/project.pbxproj
# xcode sample files
EXTRA_DIST += \
xcode/Samples/FrameworkSample/Info.plist \
xcode/Samples/FrameworkSample/widget_test.cc \
xcode/Samples/FrameworkSample/widget.cc \
xcode/Samples/FrameworkSample/widget.h \
xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj
# TODO(wan@google.com): integrate scripts/gen_gtest_pred_impl.py into
# the build system such that a user can specify the maximum predicate
# arity here and have the script automatically generate the
@@ -31,14 +65,16 @@ lib_libgtest_la_SOURCES = src/gtest.cc \
src/gtest-death-test.cc \
src/gtest-filepath.cc \
src/gtest-internal-inl.h \
src/gtest-port.cc
src/gtest-port.cc \
src/gtest-typed-test.cc
pkginclude_HEADERS = include/gtest/gtest.h \
include/gtest/gtest-death-test.h \
include/gtest/gtest-message.h \
include/gtest/gtest-spi.h \
include/gtest/gtest_pred_impl.h \
include/gtest/gtest_prod.h
include/gtest/gtest_prod.h \
include/gtest/gtest-typed-test.h
pkginclude_internaldir = $(pkgincludedir)/internal
pkginclude_internal_HEADERS = \
@@ -46,7 +82,8 @@ pkginclude_internal_HEADERS = \
include/gtest/internal/gtest-filepath.h \
include/gtest/internal/gtest-internal.h \
include/gtest/internal/gtest-port.h \
include/gtest/internal/gtest-string.h
include/gtest/internal/gtest-string.h \
include/gtest/internal/gtest-type-util.h
lib_libgtest_main_la_SOURCES = src/gtest_main.cc
lib_libgtest_main_la_LIBADD = lib/libgtest.la
@@ -103,6 +140,12 @@ samples_sample5_unittest_SOURCES = samples/sample5_unittest.cc
samples_sample5_unittest_LDADD = lib/libgtest_main.la \
samples/libsamples.la
TESTS += samples/sample6_unittest
check_PROGRAMS += samples/sample6_unittest
samples_sample6_unittest_SOURCES = samples/sample6_unittest.cc
samples_sample6_unittest_LDADD = lib/libgtest_main.la \
samples/libsamples.la
TESTS += test/gtest_unittest
check_PROGRAMS += test/gtest_unittest
test_gtest_unittest_SOURCES = test/gtest_unittest.cc
@@ -166,6 +209,13 @@ check_PROGRAMS += test/gtest_stress_test
test_gtest_stress_test_SOURCES = test/gtest_stress_test.cc
test_gtest_stress_test_LDADD = lib/libgtest.la
TESTS += test/gtest-typed-test_test
check_PROGRAMS += test/gtest-typed-test_test
test_gtest_typed_test_test_SOURCES = test/gtest-typed-test_test.cc \
test/gtest-typed-test2_test.cc \
test/gtest-typed-test_test.h
test_gtest_typed_test_test_LDADD = lib/libgtest_main.la
# The following tests depend on the presence of a Python installation and are
# keyed off of it. TODO(chandlerc@google.com): While we currently only attempt
# to build and execute these tests if Autoconf has found Python v2.4 on the
+65 -6
View File
@@ -38,6 +38,17 @@ described below), there are further requirements:
* Libtool / Libtoolize
* Python version 2.4 or newer
### Windows Requirements ###
* Microsoft Visual Studio 7.1 or newer
### Cygwin Requirements ###
* Cygwin 1.5.25-14 or newer
### Mac OS X Requirements ###
* Mac OS X 10.4 Tiger or newer
* Developer Tools Installed
* Optional: Xcode 2.5 or later for univeral-binary framework; see note below.
Getting the Source
------------------
There are two primary ways of getting Google Test's source code: you can
@@ -60,14 +71,15 @@ or for a release version X.Y.*'s branch:
$ svn checkout http://googletest.googlecode.com/svn/branches/release-X.Y/ gtest-X.Y-svn
Next you will need to prepare the GNU Autotools build system. Enter the
target directory of the checkout command you used ('gtest-svn' or
'gtest-X.Y-svn' above) and proceed with the following commands:
Next you will need to prepare the GNU Autotools build system, if you
are using Linux, Mac OS X, or Cygwin. Enter the target directory of
the checkout command you used ('gtest-svn' or 'gtest-X.Y-svn' above)
and proceed with the following commands:
$ aclocal-1.9 # Where "1.9" must match the following automake command
$ libtoolize -c
$ aclocal-1.9 # Where "1.9" must match the following automake command.
$ libtoolize -c # Use "glibtoolize -c" instead on Mac OS X.
$ autoheader
$ automake-1.9 -ac # See Automake version requirements above
$ automake-1.9 -ac # See Automake version requirements above.
$ autoconf
While this is a bit complicated, it will most often be automatically re-run by
@@ -92,6 +104,7 @@ which contains all of the source code. Here are some examples in Linux:
Building the Source
-------------------
### Linux, Mac OS X (without Xcode), and Cygwin ###
There are two primary options for building the source at this point: build it
inside the source code tree, or in a separate directory. We recommend building
in a separate directory as that tends to produce both more consistent results
@@ -131,4 +144,50 @@ to uninstall the same version which you installed.
$ sudo make uninstall # Must be run against the exact same build as "install"
### Windows ###
Open the gtest.sln file in the msvc/ folder using Visual Studio, and
you are ready to build Google Test the same way you build any Visual
Studio project.
### Mac OS X (universal-binary framework) ###
Open the gtest.xcodeproj in the xcode/ folder using Xcode. Build the "gtest"
target. The universal binary framework will end up in your selected build
directory (selected in the Xcode "Preferences..." -> "Building" pane and
defaults to xcode/build).
Alternatively, run "xcodebuild" from the command line in Terminal.app. This
will build the "Release" configuration of the gtest.framework, but you can
select the "Debug" configuration with a command line option. See the
xcodebuild man page for more information.
To use the gtest.framework, add the framework to your own project.
Create a new executable target and add the framework to the "Link Binary With
Libraries" build phase. Select "Edit Active Executable" from the "Project"
menu. In the "Arguments" tab, add
"DYLD_FRAMEWORK_PATH" : "/real/framework/path"
in the "Variables to be set in the environment:" list, where you replace
"/real/framework/path" with the actual location of the gtest.framework. Now
when you run your executable, it will load the framework and your test will
run as expected.
Regenerating Source Files
-------------------------
Some of Google Test's source files are generated from templates (not
in the C++ sense) using a script. A template file is named FOO.pump,
where FOO is the name of the file it will generate. For example, the
file include/gtest/internal/gtest-type-util.h.pump is used to generate
gtest-type-util.h in the same directory.
Normally you don't need to worry about regenerating the source files,
unless you need to modify them (e.g. if you are working on a patch for
Google Test). In that case, you should modify the corresponding .pump
files instead and run the 'pump' script (for Pump is Useful for Meta
Programming) to regenerate them. We are still working on releasing
the script and its documentation. If you need it now, please email
googletestframework@googlegroups.com such that we know to make it
happen sooner.
Happy testing!
+5 -1
View File
@@ -1,5 +1,9 @@
# At this point, the Xcode project assumes the version string will be three
# integers separated by periods and surrounded by square brackets (e.g.
# "[1.0.1]"). It also asumes that there won't be any closing parenthesis
# between "AC_INIT(" and the closing ")" including comments and strings.
AC_INIT([Google C++ Testing Framework],
[1.0.0],
[1.1.0],
[googletestframework@googlegroups.com],
[gtest])
+20 -16
View File
@@ -56,29 +56,19 @@ GTEST_DECLARE_string(death_test_style);
// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
// executed:
//
// 1. The assertion fails immediately if there are more than one
// active threads. This is because it's safe to fork() only when
// there is a single thread.
// 1. It generates a warning if there is more than one active
// thread. This is because it's safe to fork() or clone() only
// when there is a single thread.
//
// 2. The parent process forks a sub-process and runs the death test
// in it; the sub-process exits with code 0 at the end of the death
// test, if it hasn't exited already.
// 2. The parent process clone()s a sub-process and runs the death
// test in it; the sub-process exits with code 0 at the end of the
// death test, if it hasn't exited already.
//
// 3. The parent process waits for the sub-process to terminate.
//
// 4. The parent process checks the exit code and error message of
// the sub-process.
//
// Note:
//
// It's not safe to call exit() if the current process is forked from
// a multi-threaded process, so people usually call _exit() instead in
// such a case. However, we are not concerned with this as we run
// death tests only when there is a single thread. Since exit() has a
// cleaner semantics (it also calls functions registered with atexit()
// and on_exit()), this macro calls exit() instead of _exit() to
// terminate the child process.
//
// Examples:
//
// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
@@ -95,6 +85,20 @@ GTEST_DECLARE_string(death_test_style);
// }
//
// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
//
// Known caveats:
//
// A "threadsafe" style death test obtains the path to the test
// program from argv[0] and re-executes it in the sub-process. For
// simplicity, the current implementation doesn't search the PATH
// when launching the sub-process. This means that the user must
// invoke the test program via a path that contains at least one
// path separator (e.g. path/to/foo_test and
// /absolute/path/to/bar_test are fine, but foo_test is not). This
// is rarely a problem as people usually don't put the test binary
// directory in PATH.
//
// TODO(wan@google.com): make thread-safe death tests search the PATH.
// Asserts that a given statement causes the program to exit, with an
// integer exit status that satisfies predicate, and emitting error output
-12
View File
@@ -46,20 +46,8 @@
#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-string.h" // NOLINT
#include "gtest-internal.h" // NOLINT
#else
#include <gtest/internal/gtest-string.h>
#include <gtest/internal/gtest-internal.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
namespace testing {
+253
View File
@@ -0,0 +1,253 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
// This header implements typed tests and type-parameterized tests.
// Typed (aka type-driven) tests repeat the same test for types in a
// list. You must know which types you want to test with when writing
// typed tests. Here's how you do it:
#if 0
// First, define a fixture class template. It should be parameterized
// by a type. Remember to derive it from testing::Test.
template <typename T>
class FooTest : public testing::Test {
public:
...
typedef std::list<T> List;
static T shared_;
T value_;
};
// Next, associate a list of types with the test case, which will be
// repeated for each type in the list. The typedef is necessary for
// the macro to parse correctly.
typedef testing::Types<char, int, unsigned int> MyTypes;
TYPED_TEST_CASE(FooTest, MyTypes);
// If the type list contains only one type, you can write that type
// directly without Types<...>:
// TYPED_TEST_CASE(FooTest, int);
// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
// tests for this test case as you want.
TYPED_TEST(FooTest, DoesBlah) {
// Inside a test, refer to TypeParam to get the type parameter.
// Since we are inside a derived class template, C++ requires use to
// visit the members of FooTest via 'this'.
TypeParam n = this->value_;
// To visit static members of the fixture, add the TestFixture::
// prefix.
n += TestFixture::shared_;
// To refer to typedefs in the fixture, add the "typename
// TestFixture::" prefix.
typename TestFixture::List values;
values.push_back(n);
...
}
TYPED_TEST(FooTest, HasPropertyA) { ... }
#endif // 0
// Type-parameterized tests are abstract test patterns parameterized
// by a type. Compared with typed tests, type-parameterized tests
// allow you to define the test pattern without knowing what the type
// parameters are. The defined pattern can be instantiated with
// different types any number of times, in any number of translation
// units.
//
// If you are designing an interface or concept, you can define a
// suite of type-parameterized tests to verify properties that any
// valid implementation of the interface/concept should have. Then,
// each implementation can easily instantiate the test suite to verify
// that it conforms to the requirements, without having to write
// similar tests repeatedly. Here's an example:
#if 0
// First, define a fixture class template. It should be parameterized
// by a type. Remember to derive it from testing::Test.
template <typename T>
class FooTest : public testing::Test {
...
};
// Next, declare that you will define a type-parameterized test case
// (the _P suffix is for "parameterized" or "pattern", whichever you
// prefer):
TYPED_TEST_CASE_P(FooTest);
// Then, use TYPED_TEST_P() to define as many type-parameterized tests
// for this type-parameterized test case as you want.
TYPED_TEST_P(FooTest, DoesBlah) {
// Inside a test, refer to TypeParam to get the type parameter.
TypeParam n = 0;
...
}
TYPED_TEST_P(FooTest, HasPropertyA) { ... }
// Now the tricky part: you need to register all test patterns before
// you can instantiate them. The first argument of the macro is the
// test case name; the rest are the names of the tests in this test
// case.
REGISTER_TYPED_TEST_CASE_P(FooTest,
DoesBlah, HasPropertyA);
// Finally, you are free to instantiate the pattern with the types you
// want. If you put the above code in a header file, you can #include
// it in multiple C++ source files and instantiate it multiple times.
//
// To distinguish different instances of the pattern, the first
// argument to the INSTANTIATE_* macro is a prefix that will be added
// to the actual test case name. Remember to pick unique prefixes for
// different instances.
typedef testing::Types<char, int, unsigned int> MyTypes;
INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
// If the type list contains only one type, you can write that type
// directly without Types<...>:
// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
#endif // 0
#include <gtest/internal/gtest-port.h>
#include <gtest/internal/gtest-type-util.h>
// Implements typed tests.
#ifdef GTEST_HAS_TYPED_TEST
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Expands to the name of the typedef for the type parameters of the
// given test case.
#define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
#define TYPED_TEST_CASE(CaseName, Types) \
typedef ::testing::internal::TypeList<Types>::type \
GTEST_TYPE_PARAMS_(CaseName)
#define TYPED_TEST(CaseName, TestName) \
template <typename gtest_TypeParam_> \
class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
: public CaseName<gtest_TypeParam_> { \
private: \
typedef CaseName<gtest_TypeParam_> TestFixture; \
typedef gtest_TypeParam_ TypeParam; \
virtual void TestBody(); \
}; \
bool gtest_##CaseName##_##TestName##_registered_ = \
::testing::internal::TypeParameterizedTest< \
CaseName, \
::testing::internal::TemplateSel< \
GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
GTEST_TYPE_PARAMS_(CaseName)>::Register(\
"", #CaseName, #TestName, 0); \
template <typename gtest_TypeParam_> \
void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
#endif // GTEST_HAS_TYPED_TEST
// Implements type-parameterized tests.
#ifdef GTEST_HAS_TYPED_TEST_P
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Expands to the namespace name that the type-parameterized tests for
// the given type-parameterized test case are defined in. The exact
// name of the namespace is subject to change without notice.
#define GTEST_CASE_NAMESPACE_(TestCaseName) \
gtest_case_##TestCaseName##_
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Expands to the name of the variable used to remember the names of
// the defined tests in the given test case.
#define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
gtest_typed_test_case_p_state_##TestCaseName##_
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
//
// Expands to the name of the variable used to remember the names of
// the registered tests in the given test case.
#define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
gtest_registered_test_names_##TestCaseName##_
// The variables defined in the type-parameterized test macros are
// static as typically these macros are used in a .h file that can be
// #included in multiple translation units linked together.
#define TYPED_TEST_CASE_P(CaseName) \
static ::testing::internal::TypedTestCasePState \
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
#define TYPED_TEST_P(CaseName, TestName) \
namespace GTEST_CASE_NAMESPACE_(CaseName) { \
template <typename gtest_TypeParam_> \
class TestName : public CaseName<gtest_TypeParam_> { \
private: \
typedef CaseName<gtest_TypeParam_> TestFixture; \
typedef gtest_TypeParam_ TypeParam; \
virtual void TestBody(); \
}; \
static bool gtest_##TestName##_defined_ = \
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
__FILE__, __LINE__, #CaseName, #TestName); \
} \
template <typename gtest_TypeParam_> \
void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
#define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
namespace GTEST_CASE_NAMESPACE_(CaseName) { \
typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
} \
static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
__FILE__, __LINE__, #__VA_ARGS__)
#define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
bool gtest_##Prefix##_##CaseName = \
::testing::internal::TypeParameterizedTestCase<CaseName, \
GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
::testing::internal::TypeList<Types>::type>::Register(\
#Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
#endif // GTEST_HAS_TYPED_TEST_P
#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+68 -76
View File
@@ -62,26 +62,13 @@
// Windows proper with Visual C++ and MS C library (_MSC_VER && !_WIN32_WCE) and
// Windows Mobile with Visual C++ and no C library (_WIN32_WCE).
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes
// will be in the framework headers folder along with gtest.h. Define
// GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on the
// Mac and are not using it as a framework. More info on frameworks
// available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-death-test.h" // NOLINT
#include "gtest-internal.h" // NOLINT
#include "gtest-message.h" // NOLINT
#include "gtest-string.h" // NOLINT
#include "gtest_prod.h" // NOLINT
#else
#include <limits>
#include <gtest/internal/gtest-internal.h>
#include <gtest/internal/gtest-string.h>
#include <gtest/gtest-death-test.h>
#include <gtest/gtest-message.h>
#include <gtest/gtest_prod.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
#include <gtest/gtest-typed-test.h>
// Depending on the platform, different string classes are available.
// On Windows, ::std::string compiles only when exceptions are
@@ -232,12 +219,28 @@ class Test {
// Defines types for pointers to functions that set up and tear down
// a test case.
typedef void (*SetUpTestCaseFunc)();
typedef void (*TearDownTestCaseFunc)();
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
// The d'tor is virtual as we intend to inherit from Test.
virtual ~Test();
// Sets up the stuff shared by all tests in this test case.
//
// Google Test will call Foo::SetUpTestCase() before running the first
// test in test case Foo. Hence a sub-class can define its own
// SetUpTestCase() method to shadow the one defined in the super
// class.
static void SetUpTestCase() {}
// Tears down the stuff shared by all tests in this test case.
//
// Google Test will call Foo::TearDownTestCase() after running the last
// test in test case Foo. Hence a sub-class can define its own
// TearDownTestCase() method to shadow the one defined in the super
// class.
static void TearDownTestCase() {}
// Returns true iff the current test has a fatal failure.
static bool HasFatalFailure();
@@ -260,22 +263,6 @@ class Test {
// Creates a Test object.
Test();
// Sets up the stuff shared by all tests in this test case.
//
// Google Test will call Foo::SetUpTestCase() before running the first
// test in test case Foo. Hence a sub-class can define its own
// SetUpTestCase() method to shadow the one defined in the super
// class.
static void SetUpTestCase() {}
// Tears down the stuff shared by all tests in this test case.
//
// Google Test will call Foo::TearDownTestCase() after running the last
// test in test case Foo. Hence a sub-class can define its own
// TearDownTestCase() method to shadow the one defined in the super
// class.
static void TearDownTestCase() {}
// Sets up the test fixture.
virtual void SetUp();
@@ -325,11 +312,6 @@ class Test {
};
// Defines the type of a function pointer that creates a Test object
// when invoked.
typedef Test* (*TestMaker)();
// A TestInfo object stores the following information about a test:
//
// Test case name
@@ -347,34 +329,18 @@ class TestInfo {
// don't inherit from TestInfo.
~TestInfo();
// Creates a TestInfo object and registers it with the UnitTest
// singleton; returns the created object.
//
// Arguments:
//
// test_case_name: name of the test case
// name: name of the test
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
// maker: pointer to the function that creates a test object
//
// This is public only because it's needed by the TEST and TEST_F macros.
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
static TestInfo* MakeAndRegisterInstance(
const char* test_case_name,
const char* name,
internal::TypeId fixture_class_id,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
TestMaker maker);
// Returns the test case name.
const char* test_case_name() const;
// Returns the test name.
const char* name() const;
// Returns the test case comment.
const char* test_case_comment() const;
// Returns the test comment.
const char* comment() const;
// Returns true if this test should run.
//
// Google Test allows the user to filter the tests by their full names.
@@ -401,6 +367,13 @@ class TestInfo {
friend class internal::UnitTestImpl;
friend class Test;
friend class TestCase;
friend TestInfo* internal::MakeAndRegisterTestInfo(
const char* test_case_name, const char* name,
const char* test_case_comment, const char* comment,
internal::TypeId fixture_class_id,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
internal::TestFactoryBase* factory);
// Increments the number of death tests encountered in this test so
// far.
@@ -410,9 +383,12 @@ class TestInfo {
internal::TestInfoImpl* impl() { return impl_; }
const internal::TestInfoImpl* impl() const { return impl_; }
// Constructs a TestInfo object.
// Constructs a TestInfo object. The newly constructed instance assumes
// ownership of the factory object.
TestInfo(const char* test_case_name, const char* name,
internal::TypeId fixture_class_id, TestMaker maker);
const char* test_case_comment, const char* comment,
internal::TypeId fixture_class_id,
internal::TestFactoryBase* factory);
// An opaque implementation object.
internal::TestInfoImpl* impl_;
@@ -503,6 +479,10 @@ class UnitTest {
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
int Run() GTEST_MUST_USE_RESULT;
// Returns the working directory when the first TEST() or TEST_F()
// was executed. The UnitTest object owns the string.
const char* original_working_dir() const;
// Returns the TestCase object for the test that's currently running,
// or NULL if no test is running.
const TestCase* current_test_case() const;
@@ -948,6 +928,28 @@ class AssertHelper {
// Generates a success with a generic message.
#define SUCCEED() GTEST_SUCCESS("Succeeded")
// Macros for testing exceptions.
//
// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
// Tests that the statement throws the expected exception.
// * {ASSERT|EXPECT}_NO_THROW(statement):
// Tests that the statement doesn't throw any exception.
// * {ASSERT|EXPECT}_ANY_THROW(statement):
// Tests that the statement throws an exception.
#define EXPECT_THROW(statement, expected_exception) \
GTEST_TEST_THROW(statement, expected_exception, GTEST_NONFATAL_FAILURE)
#define EXPECT_NO_THROW(statement) \
GTEST_TEST_NO_THROW(statement, GTEST_NONFATAL_FAILURE)
#define EXPECT_ANY_THROW(statement) \
GTEST_TEST_ANY_THROW(statement, GTEST_NONFATAL_FAILURE)
#define ASSERT_THROW(statement, expected_exception) \
GTEST_TEST_THROW(statement, expected_exception, GTEST_FATAL_FAILURE)
#define ASSERT_NO_THROW(statement) \
GTEST_TEST_NO_THROW(statement, GTEST_FATAL_FAILURE)
#define ASSERT_ANY_THROW(statement) \
GTEST_TEST_ANY_THROW(statement, GTEST_FATAL_FAILURE)
// Boolean assertions.
#define EXPECT_TRUE(condition) \
GTEST_TEST_BOOLEAN(condition, #condition, false, true, \
@@ -964,18 +966,7 @@ class AssertHelper {
// Includes the auto-generated header that implements a family of
// generic predicate assertion macros.
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest_pred_impl.h" // NOLINT
#else
#include <gtest/gtest_pred_impl.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// Macros for testing equalities and inequalities.
//
@@ -1145,9 +1136,10 @@ AssertionResult DoubleLE(const char* expr1, const char* expr2,
//
// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
//
// When expr unexpectedly fails or succeeds, Google Test prints the expected result
// and the actual result with both a human-readable string representation of
// the error, if available, as well as the hex result code.
// When expr unexpectedly fails or succeeds, Google Test prints the
// expected result and the actual result with both a human-readable
// string representation of the error, if available, as well as the
// hex result code.
#define EXPECT_HRESULT_SUCCEEDED(expr) \
EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
+6 -12
View File
@@ -40,19 +40,7 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-string.h" // NOLINT
#else
#include <gtest/internal/gtest-string.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
namespace testing {
namespace internal {
@@ -82,6 +70,9 @@ class FilePath {
String ToString() const { return pathname_; }
const char* c_str() const { return pathname_.c_str(); }
// Returns the current working directory, or "" if unsuccessful.
static FilePath GetCurrentDir();
// Given directory = "dir", base_name = "test", number = 0,
// extension = "xml", returns "dir/test.xml". If number is greater
// than zero (e.g., 12), returns "dir/test_12.xml".
@@ -103,6 +94,9 @@ class FilePath {
const FilePath& base_name,
const char* extension);
// Returns true iff the path is NULL or "".
bool IsEmpty() const { return c_str() == NULL || *c_str() == '\0'; }
// If input name has a trailing separator character, removes it and returns
// the name, otherwise return the name string unmodified.
// On Windows platform, uses \ as the separator, other platforms use /.
+289 -42
View File
@@ -37,18 +37,7 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-port.h" // NOLINT
#else
#include <gtest/internal/gtest-port.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
#ifdef GTEST_OS_LINUX
#include <stdlib.h>
@@ -57,23 +46,15 @@
#include <unistd.h>
#endif // GTEST_OS_LINUX
#include <iomanip> // NOLINT
#include <limits> // NOLINT
#include <ctype.h>
#include <string.h>
#include <iomanip>
#include <limits>
#include <set>
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-string.h" // NOLINT
#include "gtest-filepath.h" // NOLINT
#else
#include <gtest/internal/gtest-string.h>
#include <gtest/internal/gtest-filepath.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
#include <gtest/internal/gtest-type-util.h>
// Due to C++ preprocessor weirdness, we need double indirection to
// concatenate two tokens when one of them is __LINE__. Writing
@@ -121,6 +102,7 @@ namespace testing {
// Forward declaration of classes.
class Message; // Represents a failure message.
class Test; // Represents a test.
class TestCase; // A collection of related tests.
class TestPartResult; // Result of a test part.
class TestInfo; // Information about a test.
@@ -264,11 +246,11 @@ String FormatForFailureMessage(wchar_t wchar);
// This internal macro is used to avoid duplicated code.
#define GTEST_FORMAT_IMPL(operand2_type, operand1_printer)\
inline String FormatForComparisonFailureMessage(\
operand2_type::value_type* str, const operand2_type& operand2) {\
operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
return operand1_printer(str);\
}\
inline String FormatForComparisonFailureMessage(\
const operand2_type::value_type* str, const operand2_type& operand2) {\
const operand2_type::value_type* str, const operand2_type& /*operand2*/) {\
return operand1_printer(str);\
}
@@ -507,6 +489,31 @@ inline TypeId GetTypeId() {
return &dummy;
}
// Defines the abstract factory interface that creates instances
// of a Test object.
class TestFactoryBase {
public:
virtual ~TestFactoryBase() {}
// Creates a test instance to run. The instance is both created and destroyed
// within TestInfoImpl::Run()
virtual Test* CreateTest() = 0;
protected:
TestFactoryBase() {}
private:
GTEST_DISALLOW_COPY_AND_ASSIGN(TestFactoryBase);
};
// This class provides implementation of TeastFactoryBase interface.
// It is used in TEST and TEST_F macros.
template <class TestClass>
class TestFactoryImpl : public TestFactoryBase {
public:
virtual Test* CreateTest() { return new TestClass; }
};
#ifdef GTEST_OS_WINDOWS
// Predicate-formatters for implementing the HRESULT checking macros
@@ -518,6 +525,182 @@ AssertionResult IsHRESULTFailure(const char* expr, long hr); // NOLINT
#endif // GTEST_OS_WINDOWS
// Formats a source file path and a line number as they would appear
// in a compiler error message.
inline String FormatFileLocation(const char* file, int line) {
const char* const file_name = file == NULL ? "unknown file" : file;
if (line < 0) {
return String::Format("%s:", file_name);
}
#ifdef _MSC_VER
return String::Format("%s(%d):", file_name, line);
#else
return String::Format("%s:%d:", file_name, line);
#endif // _MSC_VER
}
// Types of SetUpTestCase() and TearDownTestCase() functions.
typedef void (*SetUpTestCaseFunc)();
typedef void (*TearDownTestCaseFunc)();
// Creates a new TestInfo object and registers it with Google Test;
// returns the created object.
//
// Arguments:
//
// test_case_name: name of the test case
// name: name of the test
// test_case_comment: a comment on the test case that will be included in
// the test output
// comment: a comment on the test that will be included in the
// test output
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
// factory: pointer to the factory that creates a test object.
// The newly created TestInfo instance will assume
// ownership of the factory object.
TestInfo* MakeAndRegisterTestInfo(
const char* test_case_name, const char* name,
const char* test_case_comment, const char* comment,
TypeId fixture_class_id,
SetUpTestCaseFunc set_up_tc,
TearDownTestCaseFunc tear_down_tc,
TestFactoryBase* factory);
#if defined(GTEST_HAS_TYPED_TEST) || defined(GTEST_HAS_TYPED_TEST_P)
// State of the definition of a type-parameterized test case.
class TypedTestCasePState {
public:
TypedTestCasePState() : registered_(false) {}
// Adds the given test name to defined_test_names_ and return true
// if the test case hasn't been registered; otherwise aborts the
// program.
bool AddTestName(const char* file, int line, const char* case_name,
const char* test_name) {
if (registered_) {
fprintf(stderr, "%s Test %s must be defined before "
"REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
FormatFileLocation(file, line).c_str(), test_name, case_name);
abort();
}
defined_test_names_.insert(test_name);
return true;
}
// Verifies that registered_tests match the test names in
// defined_test_names_; returns registered_tests if successful, or
// aborts the program otherwise.
const char* VerifyRegisteredTestNames(
const char* file, int line, const char* registered_tests);
private:
bool registered_;
::std::set<const char*> defined_test_names_;
};
// Skips to the first non-space char after the first comma in 'str';
// returns NULL if no comma is found in 'str'.
inline const char* SkipComma(const char* str) {
const char* comma = strchr(str, ',');
if (comma == NULL) {
return NULL;
}
while (isspace(*(++comma))) {}
return comma;
}
// Returns the prefix of 'str' before the first comma in it; returns
// the entire string if it contains no comma.
inline String GetPrefixUntilComma(const char* str) {
const char* comma = strchr(str, ',');
return comma == NULL ? String(str) : String(str, comma - str);
}
// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
// registers a list of type-parameterized tests with Google Test. The
// return value is insignificant - we just need to return something
// such that we can call this function in a namespace scope.
//
// Implementation note: The GTEST_TEMPLATE_ macro declares a template
// template parameter. It's defined in gtest-type-util.h.
template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
class TypeParameterizedTest {
public:
// 'index' is the index of the test in the type list 'Types'
// specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
// Types). Valid values for 'index' are [0, N - 1] where N is the
// length of Types.
static bool Register(const char* prefix, const char* case_name,
const char* test_names, int index) {
typedef typename Types::Head Type;
typedef Fixture<Type> FixtureClass;
typedef typename GTEST_BIND_(TestSel, Type) TestClass;
// First, registers the first type-parameterized test in the type
// list.
MakeAndRegisterTestInfo(
String::Format("%s%s%s/%d", prefix, prefix[0] == '\0' ? "" : "/",
case_name, index).c_str(),
GetPrefixUntilComma(test_names).c_str(),
String::Format("TypeParam = %s", GetTypeName<Type>().c_str()).c_str(),
"",
GetTypeId<FixtureClass>(),
TestClass::SetUpTestCase,
TestClass::TearDownTestCase,
new TestFactoryImpl<TestClass>);
// Next, recurses (at compile time) with the tail of the type list.
return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
::Register(prefix, case_name, test_names, index + 1);
}
};
// The base case for the compile time recursion.
template <GTEST_TEMPLATE_ Fixture, class TestSel>
class TypeParameterizedTest<Fixture, TestSel, Types0> {
public:
static bool Register(const char* /*prefix*/, const char* /*case_name*/,
const char* /*test_names*/, int /*index*/) {
return true;
}
};
// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
// registers *all combinations* of 'Tests' and 'Types' with Google
// Test. The return value is insignificant - we just need to return
// something such that we can call this function in a namespace scope.
template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
class TypeParameterizedTestCase {
public:
static bool Register(const char* prefix, const char* case_name,
const char* test_names) {
typedef typename Tests::Head Head;
// First, register the first test in 'Test' for each type in 'Types'.
TypeParameterizedTest<Fixture, Head, Types>::Register(
prefix, case_name, test_names, 0);
// Next, recurses (at compile time) with the tail of the test list.
return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
::Register(prefix, case_name, SkipComma(test_names));
}
};
// The base case for the compile time recursion.
template <GTEST_TEMPLATE_ Fixture, typename Types>
class TypeParameterizedTestCase<Fixture, Templates0, Types> {
public:
static bool Register(const char* prefix, const char* case_name,
const char* test_names) {
return true;
}
};
#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
} // namespace internal
} // namespace testing
@@ -534,6 +717,67 @@ AssertionResult IsHRESULTFailure(const char* expr, long hr); // NOLINT
#define GTEST_SUCCESS(message) \
GTEST_MESSAGE(message, ::testing::TPRT_SUCCESS)
#define GTEST_TEST_THROW(statement, expected_exception, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER \
if (const char* gtest_msg = "") { \
bool gtest_caught_expected = false; \
try { \
statement; \
} \
catch (expected_exception const&) { \
gtest_caught_expected = true; \
} \
catch (...) { \
gtest_msg = "Expected: " #statement " throws an exception of type " \
#expected_exception ".\n Actual: it throws a different " \
"type."; \
goto GTEST_CONCAT_TOKEN(gtest_label_testthrow_, __LINE__); \
} \
if (!gtest_caught_expected) { \
gtest_msg = "Expected: " #statement " throws an exception of type " \
#expected_exception ".\n Actual: it throws nothing."; \
goto GTEST_CONCAT_TOKEN(gtest_label_testthrow_, __LINE__); \
} \
} else \
GTEST_CONCAT_TOKEN(gtest_label_testthrow_, __LINE__): \
fail(gtest_msg)
#define GTEST_TEST_NO_THROW(statement, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER \
if (const char* gtest_msg = "") { \
try { \
statement; \
} \
catch (...) { \
gtest_msg = "Expected: " #statement " doesn't throw an exception.\n" \
" Actual: it throws."; \
goto GTEST_CONCAT_TOKEN(gtest_label_testnothrow_, __LINE__); \
} \
} else \
GTEST_CONCAT_TOKEN(gtest_label_testnothrow_, __LINE__): \
fail(gtest_msg)
#define GTEST_TEST_ANY_THROW(statement, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER \
if (const char* gtest_msg = "") { \
bool gtest_caught_any = false; \
try { \
statement; \
} \
catch (...) { \
gtest_caught_any = true; \
} \
if (!gtest_caught_any) { \
gtest_msg = "Expected: " #statement " throws an exception.\n" \
" Actual: it doesn't."; \
goto GTEST_CONCAT_TOKEN(gtest_label_testanythrow_, __LINE__); \
} \
} else \
GTEST_CONCAT_TOKEN(gtest_label_testanythrow_, __LINE__): \
fail(gtest_msg)
#define GTEST_TEST_BOOLEAN(boolexpr, booltext, actual, expected, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER \
if (boolexpr) \
@@ -541,29 +785,32 @@ AssertionResult IsHRESULTFailure(const char* expr, long hr); // NOLINT
else \
fail("Value of: " booltext "\n Actual: " #actual "\nExpected: " #expected)
// Expands to the name of the class that implements the given test.
#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
test_case_name##_##test_name##_Test
// Helper macro for defining tests.
#define GTEST_TEST(test_case_name, test_name, parent_class)\
class test_case_name##_##test_name##_Test : public parent_class {\
class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
public:\
test_case_name##_##test_name##_Test() {}\
static ::testing::Test* NewTest() {\
return new test_case_name##_##test_name##_Test;\
}\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
private:\
virtual void TestBody();\
static ::testing::TestInfo* const test_info_;\
GTEST_DISALLOW_COPY_AND_ASSIGN(test_case_name##_##test_name##_Test);\
GTEST_DISALLOW_COPY_AND_ASSIGN(\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
};\
\
::testing::TestInfo* const test_case_name##_##test_name##_Test::test_info_ =\
::testing::TestInfo::MakeAndRegisterInstance(\
#test_case_name, \
#test_name, \
::testing::internal::GetTypeId< parent_class >(), \
parent_class::SetUpTestCase, \
parent_class::TearDownTestCase, \
test_case_name##_##test_name##_Test::NewTest);\
void test_case_name##_##test_name##_Test::TestBody()
::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
::test_info_ =\
::testing::internal::MakeAndRegisterTestInfo(\
#test_case_name, #test_name, "", "", \
::testing::internal::GetTypeId< parent_class >(), \
parent_class::SetUpTestCase, \
parent_class::TearDownTestCase, \
new ::testing::internal::TestFactoryImpl<\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+40 -11
View File
@@ -66,13 +66,17 @@
// Test flag names share, in upper case.
//
// Macros indicating the current platform:
// GTEST_OS_CYGWIN - defined iff compiled on Cygwin.
// GTEST_OS_LINUX - defined iff compiled on Linux.
// GTEST_OS_MAC - defined iff compiled on Mac OS X.
// GTEST_OS_WINDOWS - defined iff compiled on Windows.
// Note that it is possible that none of the GTEST_OS_ macros are defined.
//
// Macros indicating available Google Test features:
// GTEST_HAS_DEATH_TEST - defined iff death tests are supported.
// GTEST_HAS_DEATH_TEST - defined iff death tests are supported.
// GTEST_HAS_TYPED_TEST - defined iff typed tests are supported.
// GTEST_HAS_TYPED_TEST_P - defined iff type-parameterized tests are
// supported.
//
// Macros for basic C++ coding:
// GTEST_AMBIGUOUS_ELSE_BLOCKER - for disabling a gcc warning.
@@ -124,8 +128,6 @@
// Int32FromGTestEnv() - parses an Int32 environment variable.
// StringFromGTestEnv() - parses a string environment variable.
#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
@@ -134,7 +136,9 @@
#define GTEST_FLAG_PREFIX_UPPER "GTEST_"
// Determines the platform on which Google Test is compiled.
#ifdef _MSC_VER
#ifdef __CYGWIN__
#define GTEST_OS_CYGWIN
#elif defined _MSC_VER
// TODO(kenton@google.com): GTEST_OS_WINDOWS is currently used to mean
// both "The OS is Windows" and "The compiler is MSVC". These
// meanings really should be separated in order to better support
@@ -215,14 +219,30 @@
#if GTEST_HAS_STD_STRING && defined(GTEST_OS_LINUX)
#define GTEST_HAS_DEATH_TEST
// On some platforms, <regex.h> needs someone to define size_t, and
// won't compile if being #included first. Therefore it's important
// that we #include it after <sys/types.h>.
// won't compile otherwise. We can #include it here as we already
// included <stdlib.h>, which is guaranteed to define size_t through
// <stddef.h>.
#include <regex.h>
#include <vector>
#include <fcntl.h>
#include <sys/mman.h>
#endif // GTEST_HAS_STD_STRING && defined(GTEST_OS_LINUX)
// Determines whether to support type-driven tests.
// Typed tests need <typeinfo> and variadic macros, which gcc and VC
// 8.0+ support.
#if defined(__GNUC__) || (_MSC_VER >= 1400)
#define GTEST_HAS_TYPED_TEST
#define GTEST_HAS_TYPED_TEST_P
#endif // defined(__GNUC__) || (_MSC_VER >= 1400)
// Determines whether the system compiler uses UTF-16 for encoding wide strings.
#if defined(GTEST_OS_WINDOWS) || defined(GTEST_OS_CYGWIN) || \
defined(__SYMBIAN32__)
#define GTEST_WIDE_STRING_USES_UTF16_ 1
#endif
// Defines some utility macros.
// The GNU compiler emits a warning if nested "if" statements are followed by
@@ -247,11 +267,11 @@
// struct Foo {
// Foo() { ... }
// } GTEST_ATTRIBUTE_UNUSED;
#if defined(GTEST_OS_WINDOWS) || (defined(GTEST_OS_LINUX) && defined(SWIG))
#define GTEST_ATTRIBUTE_UNUSED
#else
#if defined(__GNUC__) && !defined(COMPILER_ICC)
#define GTEST_ATTRIBUTE_UNUSED __attribute__ ((unused))
#endif // GTEST_OS_WINDOWS || (GTEST_OS_LINUX && SWIG)
#else
#define GTEST_ATTRIBUTE_UNUSED
#endif
// A macro to disallow the evil copy constructor and operator= functions
// This should be used in the private: declarations for a class.
@@ -428,7 +448,7 @@ const ::std::vector<String>& GetArgvs();
class Mutex {
public:
Mutex() {}
explicit Mutex(int unused) {}
explicit Mutex(int /*unused*/) {}
void AssertHeld() const {}
enum { NO_CONSTRUCTOR_NEEDED_FOR_STATIC_MUTEX = 0 };
};
@@ -580,6 +600,15 @@ inline const char* GetEnv(const char* name) {
#endif
}
#ifdef _WIN32_WCE
// Windows CE has no C library. The abort() function is used in
// several places in Google Test. This implementation provides a reasonable
// imitation of standard behaviour.
void abort();
#else
inline void abort() { ::abort(); }
#endif // _WIN32_WCE
// Macro for referencing flags.
#define GTEST_FLAG(name) FLAGS_gtest_##name
+45 -12
View File
@@ -42,19 +42,7 @@
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
#include <string.h>
#if defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
// When using Google Test on the Mac as a framework, all the includes will be
// in the framework headers folder along with gtest.h.
// Define GTEST_NOT_MAC_FRAMEWORK_MODE if you are building Google Test on
// the Mac and are not using it as a framework.
// More info on frameworks available here:
// http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/
// Concepts/WhatAreFrameworks.html.
#include "gtest-port.h" // NOLINT
#else
#include <gtest/internal/gtest-port.h>
#endif // defined(__APPLE__) && !defined(GTEST_NOT_MAC_FRAMEWORK_MODE)
namespace testing {
namespace internal {
@@ -119,6 +107,32 @@ class String {
// memory using malloc().
static const char* CloneCString(const char* c_str);
#ifdef _WIN32_WCE
// Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
// able to pass strings to Win32 APIs on CE we need to convert them
// to 'Unicode', UTF-16.
// Creates a UTF-16 wide string from the given ANSI string, allocating
// memory using new. The caller is responsible for deleting the return
// value using delete[]. Returns the wide string, or NULL if the
// input is NULL.
//
// The wide string is created using the ANSI codepage (CP_ACP) to
// match the behaviour of the ANSI versions of Win32 calls and the
// C runtime.
static LPCWSTR AnsiToUtf16(const char* c_str);
// Creates an ANSI string from the given wide string, allocating
// memory using new. The caller is responsible for deleting the return
// value using delete[]. Returns the ANSI string, or NULL if the
// input is NULL.
//
// The returned string is created using the ANSI codepage (CP_ACP) to
// match the behaviour of the ANSI versions of Win32 calls and the
// C runtime.
static const char* Utf16ToAnsi(LPCWSTR utf16_str);
#endif
// Compares two C strings. Returns true iff they have the same content.
//
// Unlike strcmp(), this function can handle NULL argument(s). A
@@ -153,6 +167,21 @@ class String {
static bool CaseInsensitiveCStringEquals(const char* lhs,
const char* rhs);
// Compares two wide C strings, ignoring case. Returns true iff they
// have the same content.
//
// Unlike wcscasecmp(), this function can handle NULL argument(s).
// A NULL C string is considered different to any non-NULL wide C string,
// including the empty string.
// NB: The implementations on different platforms slightly differ.
// On windows, this method uses _wcsicmp which compares according to LC_CTYPE
// environment variable. On GNU platform this method uses wcscasecmp
// which compares according to LC_CTYPE category of the current locale.
// On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
// current locale.
static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
const wchar_t* rhs);
// Formats a list of arguments to a String, using the same format
// spec string as for printf.
//
@@ -204,6 +233,10 @@ class String {
return CStringEquals(c_str_, c_str);
}
// Returns true iff this String is less than the given C string. A NULL
// string is considered less than "".
bool operator<(const String& rhs) const { return Compare(rhs) < 0; }
// Returns true iff this String doesn't equal the given C string. A NULL
// string and a non-NULL string are considered not equal.
bool operator!=(const char* c_str) const {
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,281 @@
$$ -*- mode: c++; -*-
$var n = 50 $$ Maximum length of type lists we want to support.
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Type utilities needed for implementing typed and type-parameterized
// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
//
// Currently we support at most $n types in a list, and at most $n
// type-parameterized tests in one type-parameterized test case.
// Please contact googletestframework@googlegroups.com if you need
// more.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
#include <gtest/internal/gtest-port.h>
#include <gtest/internal/gtest-string.h>
#if defined(GTEST_HAS_TYPED_TEST) || defined(GTEST_HAS_TYPED_TEST_P)
#ifdef __GNUC__
#include <cxxabi.h>
#endif // __GNUC__
#include <typeinfo>
namespace testing {
namespace internal {
// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
// type. This can be used as a compile-time assertion to ensure that
// two types are equal.
template <typename T1, typename T2>
struct AssertTypeEq;
template <typename T>
struct AssertTypeEq<T, T> {
typedef bool type;
};
// GetTypeName<T>() returns a human-readable name of type T.
template <typename T>
String GetTypeName() {
const char* const name = typeid(T).name();
#ifdef __GNUC__
int status = 0;
// gcc's implementation of typeid(T).name() mangles the type name,
// so we have to demangle it.
char* const readable_name = abi::__cxa_demangle(name, 0, 0, &status);
const String name_str(status == 0 ? readable_name : name);
free(readable_name);
return name_str;
#else
return name;
#endif // __GNUC__
}
// A unique type used as the default value for the arguments of class
// template Types. This allows us to simulate variadic templates
// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
// support directly.
struct None {};
// The following family of struct and struct templates are used to
// represent type lists. In particular, TypesN<T1, T2, ..., TN>
// represents a type list with N types (T1, T2, ..., and TN) in it.
// Except for Types0, every struct in the family has two member types:
// Head for the first type in the list, and Tail for the rest of the
// list.
// The empty type list.
struct Types0 {};
// Type lists of length 1, 2, 3, and so on.
template <typename T1>
struct Types1 {
typedef T1 Head;
typedef Types0 Tail;
};
$range i 2..n
$for i [[
$range j 1..i
$range k 2..i
template <$for j, [[typename T$j]]>
struct Types$i {
typedef T1 Head;
typedef Types$(i-1)<$for k, [[T$k]]> Tail;
};
]]
} // namespace internal
// We don't want to require the users to write TypesN<...> directly,
// as that would require them to count the length. Types<...> is much
// easier to write, but generates horrible messages when there is a
// compiler error, as gcc insists on printing out each template
// argument, even if it has the default value (this means Types<int>
// will appear as Types<int, None, None, ..., None> in the compiler
// errors).
//
// Our solution is to combine the best part of the two approaches: a
// user would write Types<T1, ..., TN>, and Google Test will translate
// that to TypesN<T1, ..., TN> internally to make error messages
// readable. The translation is done by the 'type' member of the
// Types template.
$range i 1..n
template <$for i, [[typename T$i = internal::None]]>
struct Types {
typedef internal::Types$n<$for i, [[T$i]]> type;
};
template <>
struct Types<$for i, [[internal::None]]> {
typedef internal::Types0 type;
};
$range i 1..n-1
$for i [[
$range j 1..i
$range k i+1..n
template <$for j, [[typename T$j]]>
struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {
typedef internal::Types$i<$for j, [[T$j]]> type;
};
]]
namespace internal {
#define GTEST_TEMPLATE_ template <typename T> class
// The template "selector" struct TemplateSel<Tmpl> is used to
// represent Tmpl, which must be a class template with one type
// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
// as the type Tmpl<T>. This allows us to actually instantiate the
// template "selected" by TemplateSel<Tmpl>.
//
// This trick is necessary for simulating typedef for class templates,
// which C++ doesn't support directly.
template <GTEST_TEMPLATE_ Tmpl>
struct TemplateSel {
template <typename T>
struct Bind {
typedef Tmpl<T> type;
};
};
#define GTEST_BIND_(TmplSel, T) \
TmplSel::template Bind<T>::type
// A unique struct template used as the default value for the
// arguments of class template Templates. This allows us to simulate
// variadic templates (e.g. Templates<int>, Templates<int, double>,
// and etc), which C++ doesn't support directly.
template <typename T>
struct NoneT {};
// The following family of struct and struct templates are used to
// represent template lists. In particular, TemplatesN<T1, T2, ...,
// TN> represents a list of N templates (T1, T2, ..., and TN). Except
// for Templates0, every struct in the family has two member types:
// Head for the selector of the first template in the list, and Tail
// for the rest of the list.
// The empty template list.
struct Templates0 {};
// Template lists of length 1, 2, 3, and so on.
template <GTEST_TEMPLATE_ T1>
struct Templates1 {
typedef TemplateSel<T1> Head;
typedef Templates0 Tail;
};
$range i 2..n
$for i [[
$range j 1..i
$range k 2..i
template <$for j, [[GTEST_TEMPLATE_ T$j]]>
struct Templates$i {
typedef TemplateSel<T1> Head;
typedef Templates$(i-1)<$for k, [[T$k]]> Tail;
};
]]
// We don't want to require the users to write TemplatesN<...> directly,
// as that would require them to count the length. Templates<...> is much
// easier to write, but generates horrible messages when there is a
// compiler error, as gcc insists on printing out each template
// argument, even if it has the default value (this means Templates<list>
// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
// errors).
//
// Our solution is to combine the best part of the two approaches: a
// user would write Templates<T1, ..., TN>, and Google Test will translate
// that to TemplatesN<T1, ..., TN> internally to make error messages
// readable. The translation is done by the 'type' member of the
// Templates template.
$range i 1..n
template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]>
struct Templates {
typedef Templates$n<$for i, [[T$i]]> type;
};
template <>
struct Templates<$for i, [[NoneT]]> {
typedef Templates0 type;
};
$range i 1..n-1
$for i [[
$range j 1..i
$range k i+1..n
template <$for j, [[GTEST_TEMPLATE_ T$j]]>
struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {
typedef Templates$i<$for j, [[T$j]]> type;
};
]]
// The TypeList template makes it possible to use either a single type
// or a Types<...> list in TYPED_TEST_CASE() and
// INSTANTIATE_TYPED_TEST_CASE_P().
template <typename T>
struct TypeList { typedef Types1<T> type; };
$range i 1..n
template <$for i, [[typename T$i]]>
struct TypeList<Types<$for i, [[T$i]]> > {
typedef typename Types<$for i, [[T$i]]>::type type;
};
} // namespace internal
} // namespace testing
#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
Executable
+85
View File
@@ -0,0 +1,85 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_unittest", "gtest_unittest.vcproj", "{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_environment_test", "gtest_environment_test.vcproj", "{DF5FA93D-DC03-41A6-A18C-079198633450}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_prod_test", "gtest_prod_test.vcproj", "{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_color_test_", "gtest_color_test_.vcproj", "{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_env_var_test_", "gtest_env_var_test_.vcproj", "{569C6F70-F41C-47F3-A622-8A88DC43D452}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_output_test_", "gtest_output_test_.vcproj", "{A4903F73-ED6C-4972-863E-F7355EB0145E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_uninitialized_test_", "gtest_uninitialized_test_.vcproj", "{42B8A077-E162-4540-A688-246296ACAC1D}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.ActiveCfg = Debug|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug.Build.0 = Debug|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.ActiveCfg = Release|Win32
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release.Build.0 = Release|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.ActiveCfg = Debug|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug.Build.0 = Debug|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.ActiveCfg = Release|Win32
{3AF54C8A-10BF-4332-9147-F68ED9862032}.Release.Build.0 = Release|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.ActiveCfg = Debug|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Debug.Build.0 = Debug|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.ActiveCfg = Release|Win32
{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}.Release.Build.0 = Release|Win32
{DF5FA93D-DC03-41A6-A18C-079198633450}.Debug.ActiveCfg = Debug|Win32
{DF5FA93D-DC03-41A6-A18C-079198633450}.Debug.Build.0 = Debug|Win32
{DF5FA93D-DC03-41A6-A18C-079198633450}.Release.ActiveCfg = Release|Win32
{DF5FA93D-DC03-41A6-A18C-079198633450}.Release.Build.0 = Release|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.ActiveCfg = Debug|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Debug.Build.0 = Debug|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.ActiveCfg = Release|Win32
{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}.Release.Build.0 = Release|Win32
{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}.Debug.ActiveCfg = Debug|Win32
{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}.Debug.Build.0 = Debug|Win32
{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}.Release.ActiveCfg = Release|Win32
{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}.Release.Build.0 = Release|Win32
{569C6F70-F41C-47F3-A622-8A88DC43D452}.Debug.ActiveCfg = Debug|Win32
{569C6F70-F41C-47F3-A622-8A88DC43D452}.Debug.Build.0 = Debug|Win32
{569C6F70-F41C-47F3-A622-8A88DC43D452}.Release.ActiveCfg = Release|Win32
{569C6F70-F41C-47F3-A622-8A88DC43D452}.Release.Build.0 = Release|Win32
{A4903F73-ED6C-4972-863E-F7355EB0145E}.Debug.ActiveCfg = Debug|Win32
{A4903F73-ED6C-4972-863E-F7355EB0145E}.Debug.Build.0 = Debug|Win32
{A4903F73-ED6C-4972-863E-F7355EB0145E}.Release.ActiveCfg = Release|Win32
{A4903F73-ED6C-4972-863E-F7355EB0145E}.Release.Build.0 = Release|Win32
{42B8A077-E162-4540-A688-246296ACAC1D}.Debug.ActiveCfg = Debug|Win32
{42B8A077-E162-4540-A688-246296ACAC1D}.Debug.Build.0 = Debug|Win32
{42B8A077-E162-4540-A688-246296ACAC1D}.Release.ActiveCfg = Release|Win32
{42B8A077-E162-4540-A688-246296ACAC1D}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
+222
View File
@@ -0,0 +1,222 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest"
ProjectGUID="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2"
ReferencesPath="">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gtestd.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2"
ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/gtest.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\src\gtest-death-test.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\gtest-filepath.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\gtest-port.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\gtest-typed-test.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
<File
RelativePath="..\src\gtest.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\include\gtest\internal\gtest-death-test-internal.h">
</File>
<File
RelativePath="..\include\gtest\gtest-death-test.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-filepath.h">
</File>
<File
RelativePath="..\src\gtest-internal-inl.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-internal.h">
</File>
<File
RelativePath="..\include\gtest\gtest-message.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-port.h">
</File>
<File
RelativePath="..\include\gtest\gtest-spi.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-string.h">
</File>
<File
RelativePath="..\include\gtest\gtest.h">
</File>
<File
RelativePath="..\include\gtest\gtest_pred_impl.h">
</File>
<File
RelativePath="..\include\gtest\gtest_prod.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_color_test_"
ProjectGUID="{ABC5A7E8-072C-4A2D-B186-19EA5394B9C6}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_color_test_.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_color_test_.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_color_test_.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_color_test_.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_env_var_test_"
ProjectGUID="{569C6F70-F41C-47F3-A622-8A88DC43D452}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_env_var_test_.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_env_var_test_.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_env_var_test_.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_env_var_test_.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_environment_test"
ProjectGUID="{DF5FA93D-DC03-41A6-A18C-079198633450}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_environment_test.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_unittest.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_environment_test.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_environment_test.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+165
View File
@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_main"
ProjectGUID="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
CharacterSet="2"
ReferencesPath="">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/$(ProjectName)d.lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
CharacterSet="2"
ReferencesPath="&quot;..\include&quot;;&quot;..&quot;">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="4"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
OutputFile="$(OutDir)/$(ProjectName).lib"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\src\gtest_main.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\include\gtest\internal\gtest-death-test-internal.h">
</File>
<File
RelativePath="..\include\gtest\gtest-death-test.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-filepath.h">
</File>
<File
RelativePath="..\src\gtest-internal-inl.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-internal.h">
</File>
<File
RelativePath="..\include\gtest\gtest-message.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-port.h">
</File>
<File
RelativePath="..\include\gtest\gtest-spi.h">
</File>
<File
RelativePath="..\include\gtest\internal\gtest-string.h">
</File>
<File
RelativePath="..\include\gtest\gtest.h">
</File>
<File
RelativePath="..\include\gtest\gtest_pred_impl.h">
</File>
<File
RelativePath="..\include\gtest\gtest_prod.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+147
View File
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_output_test_"
ProjectGUID="{A4903F73-ED6C-4972-863E-F7355EB0145E}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_output_test_.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_output_test_.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_output_test_.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_output_test_.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
BasicRuntimeChecks="0"
UsePrecompiledHeader="0"
DebugInformationFormat="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+164
View File
@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_prod_test"
ProjectGUID="{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_prod_test.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_prod_test.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{3AF54C8A-10BF-4332-9147-F68ED9862032}"
Name="gtest_main"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_prod_test.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\test\production.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\test\production.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+144
View File
@@ -0,0 +1,144 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_uninitialized_test_"
ProjectGUID="{42B8A077-E162-4540-A688-246296ACAC1D}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_uninitialized_test_.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_uninitialized_test_.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_uninitialized_test_.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_uninitialized_test_.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+147
View File
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="gtest_unittest"
ProjectGUID="{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="5"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/gtest_unittest.pdb"
SubSystem="1"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="4"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/gtest_unittest.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name="gtest"/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\test\gtest_unittest.cc">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
BasicRuntimeChecks="0"
UsePrecompiledHeader="0"
DebugInformationFormat="3"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;..&quot;;&quot;..\include&quot;"
UsePrecompiledHeader="0"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
+301
View File
@@ -0,0 +1,301 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This sample shows how to test common properties of multiple
// implementations of the same interface (aka interface tests). We
// put the code to be tested and the tests in the same file for
// simplicity.
#include <vector>
#include <gtest/gtest.h>
// Section 1. the interface and its implementations.
// The prime table interface.
class PrimeTable {
public:
virtual ~PrimeTable() {}
// Returns true iff n is a prime number.
virtual bool IsPrime(int n) const = 0;
// Returns the smallest prime number greater than p; or returns -1
// if the next prime is beyond the capacity of the table.
virtual int GetNextPrime(int p) const = 0;
};
// Implementation #1 calculates the primes on-the-fly.
class OnTheFlyPrimeTable : public PrimeTable {
public:
virtual bool IsPrime(int n) const {
if (n <= 1) return false;
for (int i = 2; i*i <= n; i++) {
// n is divisible by an integer other than 1 and itself.
if ((n % i) == 0) return false;
}
return true;
}
virtual int GetNextPrime(int p) const {
for (int n = p + 1; n > 0; n++) {
if (IsPrime(n)) return n;
}
return -1;
}
};
// Implementation #2 pre-calculates the primes and stores the result
// in a vector.
class PreCalculatedPrimeTable : public PrimeTable {
public:
// 'max' specifies the maximum number the prime table holds.
explicit PreCalculatedPrimeTable(int max) : is_prime_(max + 1) {
CalculatePrimesUpTo(max);
}
virtual bool IsPrime(int n) const {
return 0 <= n && n < is_prime_.size() && is_prime_[n];
}
virtual int GetNextPrime(int p) const {
for (int n = p + 1; n < is_prime_.size(); n++) {
if (is_prime_[n]) return n;
}
return -1;
}
private:
void CalculatePrimesUpTo(int max) {
fill(is_prime_.begin(), is_prime_.end(), true);
is_prime_[0] = is_prime_[1] = false;
for (int i = 2; i <= max; i++) {
if (!is_prime_[i]) continue;
// Marks all multiples of i (except i itself) as non-prime.
for (int j = 2*i; j <= max; j += i) {
is_prime_[j] = false;
}
}
}
std::vector<bool> is_prime_;
};
// Sections 2. the tests.
// First, we define some factory functions for creating instances of
// the implementations. You may be able to skip this step if all your
// implementations can be constructed the same way.
template <class T>
PrimeTable* CreatePrimeTable();
template <>
PrimeTable* CreatePrimeTable<OnTheFlyPrimeTable>() {
return new OnTheFlyPrimeTable;
}
template <>
PrimeTable* CreatePrimeTable<PreCalculatedPrimeTable>() {
return new PreCalculatedPrimeTable(10000);
}
// Then we define a test fixture class template.
template <class T>
class PrimeTableTest : public testing::Test {
protected:
// The ctor calls the factory function to create a prime table
// implemented by T.
PrimeTableTest() : table_(CreatePrimeTable<T>()) {}
virtual ~PrimeTableTest() { delete table_; }
// Note that we test an implementation via the base interface
// instead of the actual implementation class. This is important
// for keeping the tests close to the real world scenario, where the
// implementation is invoked via the base interface. It avoids
// got-yas where the implementation class has a method that shadows
// a method with the same name (but slightly different argument
// types) in the base interface, for example.
PrimeTable* const table_;
};
using testing::Types;
#ifdef GTEST_HAS_TYPED_TEST
// Google Test offers two ways for reusing tests for different types.
// The first is called "typed tests". You should use it if you
// already know *all* the types you are gonna exercise when you write
// the tests.
// To write a typed test case, first use
//
// TYPED_TEST_CASE(TestCaseName, TypeList);
//
// to declare it and specify the type parameters. As with TEST_F,
// TestCaseName must match the test fixture name.
// The list of types we want to test.
typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable> Implementations;
TYPED_TEST_CASE(PrimeTableTest, Implementations);
// Then use TYPED_TEST(TestCaseName, TestName) to define a typed test,
// similar to TEST_F.
TYPED_TEST(PrimeTableTest, ReturnsFalseForNonPrimes) {
// Inside the test body, you can refer to the type parameter by
// TypeParam, and refer to the fixture class by TestFixture. We
// don't need them in this example.
// Since we are in the template world, C++ requires explicitly
// writing 'this->' when referring to members of the fixture class.
// This is something you have to learn to live with.
EXPECT_FALSE(this->table_->IsPrime(-5));
EXPECT_FALSE(this->table_->IsPrime(0));
EXPECT_FALSE(this->table_->IsPrime(1));
EXPECT_FALSE(this->table_->IsPrime(4));
EXPECT_FALSE(this->table_->IsPrime(6));
EXPECT_FALSE(this->table_->IsPrime(100));
}
TYPED_TEST(PrimeTableTest, ReturnsTrueForPrimes) {
EXPECT_TRUE(this->table_->IsPrime(2));
EXPECT_TRUE(this->table_->IsPrime(3));
EXPECT_TRUE(this->table_->IsPrime(5));
EXPECT_TRUE(this->table_->IsPrime(7));
EXPECT_TRUE(this->table_->IsPrime(11));
EXPECT_TRUE(this->table_->IsPrime(131));
}
TYPED_TEST(PrimeTableTest, CanGetNextPrime) {
EXPECT_EQ(2, this->table_->GetNextPrime(0));
EXPECT_EQ(3, this->table_->GetNextPrime(2));
EXPECT_EQ(5, this->table_->GetNextPrime(3));
EXPECT_EQ(7, this->table_->GetNextPrime(5));
EXPECT_EQ(11, this->table_->GetNextPrime(7));
EXPECT_EQ(131, this->table_->GetNextPrime(128));
}
// That's it! Google Test will repeat each TYPED_TEST for each type
// in the type list specified in TYPED_TEST_CASE. Sit back and be
// happy that you don't have to define them multiple times.
#endif // GTEST_HAS_TYPED_TEST
#ifdef GTEST_HAS_TYPED_TEST_P
// Sometimes, however, you don't yet know all the types that you want
// to test when you write the tests. For example, if you are the
// author of an interface and expect other people to implement it, you
// might want to write a set of tests to make sure each implementation
// conforms to some basic requirements, but you don't know what
// implementations will be written in the future.
//
// How can you write the tests without committing to the type
// parameters? That's what "type-parameterized tests" can do for you.
// It is a bit more involved than typed tests, but in return you get a
// test pattern that can be reused in many contexts, which is a big
// win. Here's how you do it:
// First, define a test fixture class template. Here we just reuse
// the PrimeTableTest fixture defined earlier:
template <class T>
class PrimeTableTest2 : public PrimeTableTest<T> {
};
// Then, declare the test case. The argument is the name of the test
// fixture, and also the name of the test case (as usual). The _P
// suffix is for "parameterized" or "pattern".
TYPED_TEST_CASE_P(PrimeTableTest2);
// Next, use TYPED_TEST_P(TestCaseName, TestName) to define a test,
// similar to what you do with TEST_F.
TYPED_TEST_P(PrimeTableTest2, ReturnsFalseForNonPrimes) {
EXPECT_FALSE(this->table_->IsPrime(-5));
EXPECT_FALSE(this->table_->IsPrime(0));
EXPECT_FALSE(this->table_->IsPrime(1));
EXPECT_FALSE(this->table_->IsPrime(4));
EXPECT_FALSE(this->table_->IsPrime(6));
EXPECT_FALSE(this->table_->IsPrime(100));
}
TYPED_TEST_P(PrimeTableTest2, ReturnsTrueForPrimes) {
EXPECT_TRUE(this->table_->IsPrime(2));
EXPECT_TRUE(this->table_->IsPrime(3));
EXPECT_TRUE(this->table_->IsPrime(5));
EXPECT_TRUE(this->table_->IsPrime(7));
EXPECT_TRUE(this->table_->IsPrime(11));
EXPECT_TRUE(this->table_->IsPrime(131));
}
TYPED_TEST_P(PrimeTableTest2, CanGetNextPrime) {
EXPECT_EQ(2, this->table_->GetNextPrime(0));
EXPECT_EQ(3, this->table_->GetNextPrime(2));
EXPECT_EQ(5, this->table_->GetNextPrime(3));
EXPECT_EQ(7, this->table_->GetNextPrime(5));
EXPECT_EQ(11, this->table_->GetNextPrime(7));
EXPECT_EQ(131, this->table_->GetNextPrime(128));
}
// Type-parameterized tests involve one extra step: you have to
// enumerate the tests you defined:
REGISTER_TYPED_TEST_CASE_P(
PrimeTableTest2, // The first argument is the test case name.
// The rest of the arguments are the test names.
ReturnsFalseForNonPrimes, ReturnsTrueForPrimes, CanGetNextPrime);
// At this point the test pattern is done. However, you don't have
// any real test yet as you haven't said which types you want to run
// the tests with.
// To turn the abstract test pattern into real tests, you instantiate
// it with a list of types. Usually the test pattern will be defined
// in a .h file, and anyone can #include and instantiate it. You can
// even instantiate it more than once in the same program. To tell
// different instances apart, you give each of them a name, which will
// become part of the test case name and can be used in test filters.
// The list of types we want to test. Note that it doesn't have to be
// defined at the time we write the TYPED_TEST_P()s.
typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable>
PrimeTableImplementations;
INSTANTIATE_TYPED_TEST_CASE_P(OnTheFlyAndPreCalculated, // Instance name
PrimeTableTest2, // Test case name
PrimeTableImplementations); // Type list
#endif // GTEST_HAS_TYPED_TEST_P
+26 -3
View File
@@ -34,9 +34,11 @@
#include <gtest/gtest-death-test.h>
#include <gtest/internal/gtest-port.h>
#ifdef GTEST_HAS_DEATH_TEST
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#endif // GTEST_HAS_DEATH_TEST
#include <gtest/gtest-message.h>
#include <gtest/internal/gtest-string.h>
@@ -47,7 +49,7 @@
// prevent a user from accidentally including gtest-internal-inl.h in
// his code.
#define GTEST_IMPLEMENTATION
#include "gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION
namespace testing {
@@ -544,11 +546,32 @@ struct ExecDeathTestArgs {
};
// The main function for a threadsafe-style death test child process.
// This function is called in a clone()-ed process and thus must avoid
// any potentially unsafe operations like malloc or libc functions.
static int ExecDeathTestChildMain(void* child_arg) {
ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
GTEST_DEATH_TEST_CHECK_SYSCALL(close(args->close_fd));
// We need to execute the test program in the same environment where
// it was originally invoked. Therefore we change to the original
// working directory first.
const char* const original_dir =
UnitTest::GetInstance()->original_working_dir();
// We can safely call chdir() as it's a direct system call.
if (chdir(original_dir) != 0) {
DeathTestAbort("chdir(\"%s\") failed: %s",
original_dir, strerror(errno));
return EXIT_FAILURE;
}
// We can safely call execve() as it's a direct system call. We
// cannot use execvp() as it's a libc function and thus potentially
// unsafe. Since execve() doesn't search the PATH, the user must
// invoke the test program via a valid path that contains at least
// one path separator.
execve(args->argv[0], args->argv, environ);
DeathTestAbort("execve failed: %s", strerror(errno));
DeathTestAbort("execve(%s, ...) in %s failed: %s",
args->argv[0], original_dir, strerror(errno));
return EXIT_FAILURE;
}
@@ -688,7 +711,7 @@ static void SplitString(const ::std::string& str, char delimiter,
::std::vector< ::std::string> parsed;
::std::string::size_type pos = 0;
while (true) {
const ::std::string::size_type colon = str.find(':', pos);
const ::std::string::size_type colon = str.find(delimiter, pos);
if (colon == ::std::string::npos) {
parsed.push_back(str.substr(pos));
break;
+57 -3
View File
@@ -32,12 +32,18 @@
#include <gtest/internal/gtest-filepath.h>
#include <gtest/internal/gtest-port.h>
#ifdef _WIN32
#include <stdlib.h>
#ifdef _WIN32_WCE
#include <windows.h>
#elif defined(_WIN32)
#include <direct.h>
#include <io.h>
#endif // _WIN32
#include <sys/stat.h>
#else
#include <sys/stat.h>
#include <unistd.h>
#endif // _WIN32_WCE or _WIN32
#include <gtest/internal/gtest-string.h>
@@ -47,13 +53,37 @@ namespace internal {
#ifdef GTEST_OS_WINDOWS
const char kPathSeparator = '\\';
const char kPathSeparatorString[] = "\\";
#ifdef _WIN32_WCE
// Windows CE doesn't have a current directory. You should not use
// the current directory in tests on Windows CE, but this at least
// provides a reasonable fallback.
const char kCurrentDirectoryString[] = "\\";
// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
const DWORD kInvalidFileAttributes = 0xffffffff;
#else
const char kCurrentDirectoryString[] = ".\\";
#endif // _WIN32_WCE
#else
const char kPathSeparator = '/';
const char kPathSeparatorString[] = "/";
const char kCurrentDirectoryString[] = "./";
#endif // GTEST_OS_WINDOWS
// Returns the current working directory, or "" if unsuccessful.
FilePath FilePath::GetCurrentDir() {
#ifdef _WIN32_WCE
// Windows CE doesn't have a current directory, so we just return
// something reasonable.
return FilePath(kCurrentDirectoryString);
#elif defined(GTEST_OS_WINDOWS)
char cwd[_MAX_PATH + 1] = {};
return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
#else
char cwd[PATH_MAX + 1] = {};
return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
#endif
}
// Returns a copy of the FilePath with the case-insensitive extension removed.
// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
// FilePath("dir/file"). If a case-insensitive extension is not
@@ -112,8 +142,15 @@ FilePath FilePath::MakeFileName(const FilePath& directory,
// either a file, directory, or whatever.
bool FilePath::FileOrDirectoryExists() const {
#ifdef GTEST_OS_WINDOWS
#ifdef _WIN32_WCE
LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
const DWORD attributes = GetFileAttributes(unicode);
delete [] unicode;
return attributes != kInvalidFileAttributes;
#else
struct _stat file_stat = {};
return _stat(pathname_.c_str(), &file_stat) == 0;
#endif // _WIN32_WCE
#else
struct stat file_stat = {};
return stat(pathname_.c_str(), &file_stat) == 0;
@@ -126,9 +163,19 @@ bool FilePath::DirectoryExists() const {
bool result = false;
#ifdef _WIN32
FilePath removed_sep(this->RemoveTrailingPathSeparator());
#ifdef _WIN32_WCE
LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
const DWORD attributes = GetFileAttributes(unicode);
delete [] unicode;
if ((attributes != kInvalidFileAttributes) &&
(attributes & FILE_ATTRIBUTE_DIRECTORY)) {
result = true;
}
#else
struct _stat file_stat = {};
result = _stat(removed_sep.c_str(), &file_stat) == 0 &&
(_S_IFDIR & file_stat.st_mode) != 0;
#endif // _WIN32_WCE
#else
struct stat file_stat = {};
result = stat(pathname_.c_str(), &file_stat) == 0 &&
@@ -185,7 +232,14 @@ bool FilePath::CreateDirectoriesRecursively() const {
// exist. Not named "CreateDirectory" because that's a macro on Windows.
bool FilePath::CreateFolder() const {
#ifdef _WIN32
#ifdef _WIN32_WCE
FilePath removed_sep(this->RemoveTrailingPathSeparator());
LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
int result = CreateDirectory(unicode, NULL) ? 0 : -1;
delete [] unicode;
#else
int result = _mkdir(pathname_.c_str());
#endif // !WIN32_WCE
#else
int result = mkdir(pathname_.c_str(), 0777);
#endif // _WIN32
+79 -14
View File
@@ -70,6 +70,7 @@ GTEST_DECLARE_string(color);
GTEST_DECLARE_string(filter);
GTEST_DECLARE_bool(list_tests);
GTEST_DECLARE_string(output);
GTEST_DECLARE_bool(print_time);
GTEST_DECLARE_int32(repeat);
GTEST_DECLARE_int32(stack_trace_depth);
GTEST_DECLARE_bool(show_internal_stack_frames);
@@ -79,10 +80,11 @@ namespace internal {
// Names of the flags (needed for parsing Google Test flags).
const char kBreakOnFailureFlag[] = "break_on_failure";
const char kCatchExceptionsFlag[] = "catch_exceptions";
const char kColorFlag[] = "color";
const char kFilterFlag[] = "filter";
const char kListTestsFlag[] = "list_tests";
const char kOutputFlag[] = "output";
const char kColorFlag[] = "color";
const char kPrintTimeFlag[] = "print_time";
const char kRepeatFlag[] = "repeat";
// This class saves the values of all Google Test flags in its c'tor, and
@@ -99,6 +101,7 @@ class GTestFlagSaver {
internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
list_tests_ = GTEST_FLAG(list_tests);
output_ = GTEST_FLAG(output);
print_time_ = GTEST_FLAG(print_time);
repeat_ = GTEST_FLAG(repeat);
}
@@ -112,6 +115,7 @@ class GTestFlagSaver {
GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
GTEST_FLAG(list_tests) = list_tests_;
GTEST_FLAG(output) = output_;
GTEST_FLAG(print_time) = print_time_;
GTEST_FLAG(repeat) = repeat_;
}
private:
@@ -124,12 +128,35 @@ class GTestFlagSaver {
String internal_run_death_test_;
bool list_tests_;
String output_;
bool print_time_;
bool pretty_;
internal::Int32 repeat_;
} GTEST_ATTRIBUTE_UNUSED;
// Converts a Unicode code-point to its UTF-8 encoding.
String ToUtf8String(wchar_t wchar);
// Converts a Unicode code point to a narrow string in UTF-8 encoding.
// code_point parameter is of type UInt32 because wchar_t may not be
// wide enough to contain a code point.
// The output buffer str must containt at least 32 characters.
// The function returns the address of the output buffer.
// If the code_point is not a valid Unicode code point
// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
// as '(Invalid Unicode 0xXXXXXXXX)'.
char* CodePointToUtf8(UInt32 code_point, char* str);
// Converts a wide string to a narrow string in UTF-8 encoding.
// The wide string is assumed to have the following encoding:
// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
// Parameter str points to a null-terminated wide string.
// Parameter num_chars may additionally limit the number
// of wchar_t characters processed. -1 is used when the entire string
// should be processed.
// If the string contains code points that are not valid Unicode code points
// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
// and contains invalid UTF-16 surrogate pairs, values in those pairs
// will be encoded as individual Unicode characters from Basic Normal Plane.
String WideStringToUtf8(const wchar_t* str, int num_chars);
// Returns the number of active threads, or 0 when there is an error.
size_t GetThreadCount();
@@ -536,8 +563,9 @@ class TestResult {
class TestInfoImpl {
public:
TestInfoImpl(TestInfo* parent, const char* test_case_name,
const char* name, TypeId fixture_class_id,
TestMaker maker);
const char* name, const char* test_case_comment,
const char* comment, TypeId fixture_class_id,
internal::TestFactoryBase* factory);
~TestInfoImpl();
// Returns true if this test should run.
@@ -558,6 +586,12 @@ class TestInfoImpl {
// Returns the test name.
const char* name() const { return name_.c_str(); }
// Returns the test case comment.
const char* test_case_comment() const { return test_case_comment_.c_str(); }
// Returns the test comment.
const char* comment() const { return comment_.c_str(); }
// Returns the ID of the test fixture class.
TypeId fixture_class_id() const { return fixture_class_id_; }
@@ -584,13 +618,16 @@ class TestInfoImpl {
private:
// These fields are immutable properties of the test.
TestInfo* const parent_; // The owner of this object
const String test_case_name_; // Test case name
const String name_; // Test name
const TypeId fixture_class_id_; // ID of the test fixture class
bool should_run_; // True iff this test should run
bool is_disabled_; // True iff this test is disabled
const TestMaker maker_; // The function that creates the test object
TestInfo* const parent_; // The owner of this object
const String test_case_name_; // Test case name
const String name_; // Test name
const String test_case_comment_; // Test case comment
const String comment_; // Test comment
const TypeId fixture_class_id_; // ID of the test fixture class
bool should_run_; // True iff this test should run
bool is_disabled_; // True iff this test is disabled
internal::TestFactoryBase* const factory_; // The factory that creates
// the test object
// This field is mutable and needs to be reset before running the
// test for the second time.
@@ -616,7 +653,7 @@ class TestCase {
// name: name of the test case
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
TestCase(const char* name,
TestCase(const char* name, const char* comment,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc);
@@ -626,6 +663,9 @@ class TestCase {
// Gets the name of the TestCase.
const char* name() const { return name_.c_str(); }
// Returns the test case comment.
const char* comment() const { return comment_.c_str(); }
// Returns true if any test in this test case should run.
bool should_run() const { return should_run_; }
@@ -711,6 +751,8 @@ class TestCase {
private:
// Name of the test case.
internal::String name_;
// Comment on the test case.
internal::String comment_;
// List of TestInfos.
internal::List<TestInfo*>* test_info_list_;
// Pointer to the function that sets up the test case.
@@ -771,7 +813,7 @@ class UnitTestOptions {
// This function is useful as an __except condition.
static int GTestShouldProcessSEH(DWORD exception_code);
#endif // GTEST_OS_WINDOWS
private:
// Returns true if "name" matches the ':' separated list of glob-style
// filters in "filter".
static bool MatchesFilter(const String& name, const char* filter);
@@ -947,6 +989,7 @@ class UnitTestImpl : public TestPartResultReporterInterface {
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
TestCase* GetTestCase(const char* test_case_name,
const char* comment,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc);
@@ -960,7 +1003,23 @@ class UnitTestImpl : public TestPartResultReporterInterface {
void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
TestInfo * test_info) {
// In order to support thread-safe death tests, we need to
// remember the original working directory when the test program
// was first invoked. We cannot do this in RUN_ALL_TESTS(), as
// the user may have changed the current directory before calling
// RUN_ALL_TESTS(). Therefore we capture the current directory in
// AddTestInfo(), which is called to register a TEST or TEST_F
// before main() is reached.
if (original_working_dir_.IsEmpty()) {
original_working_dir_.Set(FilePath::GetCurrentDir());
if (original_working_dir_.IsEmpty()) {
printf("%s\n", "Failed to get the current working directory.");
abort();
}
}
GetTestCase(test_info->test_case_name(),
test_info->test_case_comment(),
set_up_tc,
tear_down_tc)->AddTestInfo(test_info);
}
@@ -1039,9 +1098,15 @@ class UnitTestImpl : public TestPartResultReporterInterface {
#endif // GTEST_HAS_DEATH_TEST
private:
friend class ::testing::UnitTest;
// The UnitTest object that owns this implementation object.
UnitTest* const parent_;
// The working directory when the first TEST() or TEST_F() was
// executed.
internal::FilePath original_working_dir_;
// Points to (but doesn't own) the test part result reporter.
TestPartResultReporterInterface* test_part_result_reporter_;
+19 -3
View File
@@ -32,16 +32,22 @@
#include <gtest/internal/gtest-port.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef GTEST_HAS_DEATH_TEST
#include <regex.h>
#endif // GTEST_HAS_DEATH_TEST
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32_WCE
#include <windows.h> // For TerminateProcess()
#endif // _WIN32_WCE
#include <gtest/gtest-spi.h>
#include <gtest/gtest-message.h>
#include <gtest/internal/gtest-string.h>
namespace testing {
namespace internal {
@@ -96,7 +102,10 @@ class CapturedStderr {
CapturedStderr() {
uncaptured_fd_ = dup(STDERR_FILENO);
char name_template[] = "captured_stderr.XXXXXX";
// There's no guarantee that a test has write access to the
// current directory, so we create the temporary file in the /tmp
// directory instead.
char name_template[] = "/tmp/captured_stderr.XXXXXX";
const int captured_fd = mkstemp(name_template);
filename_ = name_template;
fflush(NULL);
@@ -191,6 +200,13 @@ const ::std::vector<String>& GetArgvs() { return g_argvs; }
#endif // GTEST_HAS_DEATH_TEST
#ifdef _WIN32_WCE
void abort() {
DebugBreak();
TerminateProcess(GetCurrentProcess(), 1);
}
#endif // _WIN32_WCE
// Returns the name of the environment variable corresponding to the
// given flag. For example, FlagToEnvVar("foo") will return
// "GTEST_FOO" in the open-source version.
+97
View File
@@ -0,0 +1,97 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include <gtest/gtest-typed-test.h>
#include <gtest/gtest.h>
namespace testing {
namespace internal {
#ifdef GTEST_HAS_TYPED_TEST_P
// Verifies that registered_tests match the test names in
// defined_test_names_; returns registered_tests if successful, or
// aborts the program otherwise.
const char* TypedTestCasePState::VerifyRegisteredTestNames(
const char* file, int line, const char* registered_tests) {
typedef ::std::set<const char*>::const_iterator DefinedTestIter;
registered_ = true;
Message errors;
::std::set<String> tests;
for (const char* names = registered_tests; names != NULL;
names = SkipComma(names)) {
const String name = GetPrefixUntilComma(names);
if (tests.count(name) != 0) {
errors << "Test " << name << " is listed more than once.\n";
continue;
}
bool found = false;
for (DefinedTestIter it = defined_test_names_.begin();
it != defined_test_names_.end();
++it) {
if (name == *it) {
found = true;
break;
}
}
if (found) {
tests.insert(name);
} else {
errors << "No test named " << name
<< " can be found in this test case.\n";
}
}
for (DefinedTestIter it = defined_test_names_.begin();
it != defined_test_names_.end();
++it) {
if (tests.count(*it) == 0) {
errors << "You forgot to list test " << *it << ".\n";
}
}
const String& errors_str = errors.GetString();
if (errors_str != "") {
fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
errors_str.c_str());
abort();
}
return registered_tests;
}
#endif // GTEST_HAS_TYPED_TEST_P
} // namespace internal
} // namespace testing
+354 -103
View File
@@ -40,6 +40,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#ifdef GTEST_OS_LINUX
@@ -117,8 +119,14 @@ namespace testing {
// Constants.
// A test that matches this pattern is disabled and not run.
static const char kDisableTestPattern[] = "DISABLED_*";
// A test whose test case name or test name matches this filter is
// disabled and not run.
static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
// A test case whose name matches this filter is considered a death
// test case and will be run before test cases whose name doesn't
// match this filter.
static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
// A test filter that matches everything.
static const char kUniversalFilter[] = "*";
@@ -169,6 +177,12 @@ GTEST_DEFINE_string(
"executable's name and, if necessary, made unique by adding "
"digits.");
GTEST_DEFINE_bool(
print_time,
internal::BoolFromGTestEnv("print_time", false),
"True iff " GTEST_NAME
" should display elapsed time in text output.");
GTEST_DEFINE_int32(
repeat,
internal::Int32FromGTestEnv("repeat", 1),
@@ -229,16 +243,6 @@ static bool ShouldRunTestCase(const TestCase* test_case) {
return test_case->should_run();
}
#ifdef _WIN32_WCE
// Windows CE has no C library. The abort() function is used in
// several places in Google Test. This implementation provides a reasonable
// imitation of standard behaviour.
static void abort() {
DebugBreak();
TerminateProcess(GetCurrentProcess(), 1);
}
#endif // _WIN32_WCE
// AssertHelper constructor.
AssertHelper::AssertHelper(TestPartResultType type, const char* file,
int line, const char* message)
@@ -459,7 +463,7 @@ void TestPartResultArray::Append(const TestPartResult& result) {
const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
if (index < 0 || index >= size()) {
printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
abort();
internal::abort();
}
const internal::ListNode<TestPartResult>* p = list_->Head();
@@ -733,6 +737,42 @@ const char * String::CloneCString(const char* c_str) {
NULL : CloneString(c_str, strlen(c_str));
}
#ifdef _WIN32_WCE
// Creates a UTF-16 wide string from the given ANSI string, allocating
// memory using new. The caller is responsible for deleting the return
// value using delete[]. Returns the wide string, or NULL if the
// input is NULL.
LPCWSTR String::AnsiToUtf16(const char* ansi) {
if (!ansi) return NULL;
const int length = strlen(ansi);
const int unicode_length =
MultiByteToWideChar(CP_ACP, 0, ansi, length,
NULL, 0);
WCHAR* unicode = new WCHAR[unicode_length + 1];
MultiByteToWideChar(CP_ACP, 0, ansi, length,
unicode, unicode_length);
unicode[unicode_length] = 0;
return unicode;
}
// Creates an ANSI string from the given wide string, allocating
// memory using new. The caller is responsible for deleting the return
// value using delete[]. Returns the ANSI string, or NULL if the
// input is NULL.
const char* String::Utf16ToAnsi(LPCWSTR utf16_str) {
if (!utf16_str) return NULL;
const int ansi_length =
WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
NULL, 0, NULL, NULL);
char* ansi = new char[ansi_length + 1];
WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
ansi, ansi_length, NULL, NULL);
ansi[ansi_length] = 0;
return ansi;
}
#endif // _WIN32_WCE
// Compares two C strings. Returns true iff they have the same content.
//
// Unlike strcmp(), this function can handle NULL argument(s). A NULL
@@ -752,16 +792,19 @@ bool String::CStringEquals(const char * lhs, const char * rhs) {
// encoding, and streams the result to the given Message object.
static void StreamWideCharsToMessage(const wchar_t* wstr, size_t len,
Message* msg) {
for (size_t i = 0; i != len; i++) {
// TODO(wan): consider allowing a testing::String object to
// contain '\0'. This will make it behave more like std::string,
// and will allow ToUtf8String() to return the correct encoding
// for '\0' s.t. we can get rid of the conditional here (and in
// several other places).
if (wstr[i]) {
*msg << internal::ToUtf8String(wstr[i]);
// TODO(wan): consider allowing a testing::String object to
// contain '\0'. This will make it behave more like std::string,
// and will allow ToUtf8String() to return the correct encoding
// for '\0' s.t. we can get rid of the conditional here (and in
// several other places).
for (size_t i = 0; i != len; ) { // NOLINT
if (wstr[i] != L'\0') {
*msg << WideStringToUtf8(wstr + i, len - i);
while (i != len && wstr[i] != L'\0')
i++;
} else {
*msg << '\0';
i++;
}
}
}
@@ -820,8 +863,10 @@ String FormatForFailureMessage(wchar_t wchar) {
Message msg;
// A String object cannot contain '\0', so we print "\\0" when wchar is
// L'\0'.
msg << "L'" << (wchar ? ToUtf8String(wchar).c_str() : "\\0") << "' ("
<< wchar_as_uint64 << ", 0x" << ::std::setbase(16)
char buffer[32]; // CodePointToUtf8 requires a buffer that big.
msg << "L'"
<< (wchar ? CodePointToUtf8(static_cast<UInt32>(wchar), buffer) : "\\0")
<< "' (" << wchar_as_uint64 << ", 0x" << ::std::setbase(16)
<< wchar_as_uint64 << ")";
return msg.GetString();
}
@@ -1285,31 +1330,118 @@ inline UInt32 ChopLowBits(UInt32* bits, int n) {
return low_bits;
}
// Converts a Unicode code-point to its UTF-8 encoding.
String ToUtf8String(wchar_t wchar) {
char str[5] = {}; // Initializes str to all '\0' characters.
UInt32 code = static_cast<UInt32>(wchar);
if (code <= kMaxCodePoint1) {
str[0] = static_cast<char>(code); // 0xxxxxxx
} else if (code <= kMaxCodePoint2) {
str[1] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xC0 | code); // 110xxxxx
} else if (code <= kMaxCodePoint3) {
str[2] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[1] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xE0 | code); // 1110xxxx
} else if (code <= kMaxCodePoint4) {
str[3] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[2] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[1] = static_cast<char>(0x80 | ChopLowBits(&code, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xF0 | code); // 11110xxx
// Converts a Unicode code point to a narrow string in UTF-8 encoding.
// code_point parameter is of type UInt32 because wchar_t may not be
// wide enough to contain a code point.
// The output buffer str must containt at least 32 characters.
// The function returns the address of the output buffer.
// If the code_point is not a valid Unicode code point
// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be output
// as '(Invalid Unicode 0xXXXXXXXX)'.
char* CodePointToUtf8(UInt32 code_point, char* str) {
if (code_point <= kMaxCodePoint1) {
str[1] = '\0';
str[0] = static_cast<char>(code_point); // 0xxxxxxx
} else if (code_point <= kMaxCodePoint2) {
str[2] = '\0';
str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
} else if (code_point <= kMaxCodePoint3) {
str[3] = '\0';
str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
} else if (code_point <= kMaxCodePoint4) {
str[4] = '\0';
str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
} else {
return String::Format("(Invalid Unicode 0x%llX)",
static_cast<UInt64>(wchar));
// The longest string String::Format can produce when invoked
// with these parameters is 28 character long (not including
// the terminating nul character). We are asking for 32 character
// buffer just in case. This is also enough for strncpy to
// null-terminate the destination string.
// MSVC 8 deprecates strncpy(), so we want to suppress warning
// 4996 (deprecated function) there.
#ifdef GTEST_OS_WINDOWS // We are on Windows.
#pragma warning(push) // Saves the current warning state.
#pragma warning(disable:4996) // Temporarily disables warning 4996.
#endif
strncpy(str, String::Format("(Invalid Unicode 0x%X)", code_point).c_str(),
32);
#ifdef GTEST_OS_WINDOWS // We are on Windows.
#pragma warning(pop) // Restores the warning state.
#endif
str[31] = '\0'; // Makes sure no change in the format to strncpy leaves
// the result unterminated.
}
return str;
}
return String(str);
// The following two functions only make sense if the the system
// uses UTF-16 for wide string encoding. All supported systems
// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
// Determines if the arguments constitute UTF-16 surrogate pair
// and thus should be combined into a single Unicode code point
// using CreateCodePointFromUtf16SurrogatePair.
inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
if (sizeof(wchar_t) == 2)
return (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
else
return false;
}
// Creates a Unicode code point from UTF16 surrogate pair.
inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
wchar_t second) {
if (sizeof(wchar_t) == 2) {
const UInt32 mask = (1 << 10) - 1;
return (((first & mask) << 10) | (second & mask)) + 0x10000;
} else {
// This should not be called, but we provide a sensible default
// in case it is.
return static_cast<UInt32>(first);
}
}
// Converts a wide string to a narrow string in UTF-8 encoding.
// The wide string is assumed to have the following encoding:
// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
// Parameter str points to a null-terminated wide string.
// Parameter num_chars may additionally limit the number
// of wchar_t characters processed. -1 is used when the entire string
// should be processed.
// If the string contains code points that are not valid Unicode code points
// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
// and contains invalid UTF-16 surrogate pairs, values in those pairs
// will be encoded as individual Unicode characters from Basic Normal Plane.
String WideStringToUtf8(const wchar_t* str, int num_chars) {
if (num_chars == -1)
num_chars = wcslen(str);
StrStream stream;
for (int i = 0; i < num_chars; ++i) {
UInt32 unicode_code_point;
if (str[i] == L'\0') {
break;
} else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
str[i + 1]);
i++;
} else {
unicode_code_point = static_cast<UInt32>(str[i]);
}
char buffer[32]; // CodePointToUtf8 requires a buffer this big.
stream << CodePointToUtf8(unicode_code_point, buffer);
}
return StrStreamToString(&stream);
}
// Converts a wide C string to a String using the UTF-8 encoding.
@@ -1317,12 +1449,7 @@ String ToUtf8String(wchar_t wchar) {
String String::ShowWideCString(const wchar_t * wide_c_str) {
if (wide_c_str == NULL) return String("(null)");
StrStream ss;
while (*wide_c_str) {
ss << internal::ToUtf8String(*wide_c_str++);
}
return internal::StrStreamToString(&ss);
return String(internal::WideStringToUtf8(wide_c_str, -1).c_str());
}
// Similar to ShowWideCString(), except that this function encloses
@@ -1397,6 +1524,40 @@ bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
#else // GTEST_OS_WINDOWS
return strcasecmp(lhs, rhs) == 0;
#endif // GTEST_OS_WINDOWS
}
// Compares two wide C strings, ignoring case. Returns true iff they
// have the same content.
//
// Unlike wcscasecmp(), this function can handle NULL argument(s).
// A NULL C string is considered different to any non-NULL wide C string,
// including the empty string.
// NB: The implementations on different platforms slightly differ.
// On windows, this method uses _wcsicmp which compares according to LC_CTYPE
// environment variable. On GNU platform this method uses wcscasecmp
// which compares according to LC_CTYPE category of the current locale.
// On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
// current locale.
bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
const wchar_t* rhs) {
if ( lhs == NULL ) return rhs == NULL;
if ( rhs == NULL ) return false;
#ifdef GTEST_OS_WINDOWS
return _wcsicmp(lhs, rhs) == 0;
#elif defined(GTEST_OS_LINUX)
return wcscasecmp(lhs, rhs) == 0;
#else
// Mac OS X and Cygwin don't define wcscasecmp. Other unknown OSes
// may not define it either.
wint_t left, right;
do {
left = towlower(*lhs++);
right = towlower(*rhs++);
} while (left && left == right);
return left == right;
#endif // OS selector
}
// Constructs a String by copying a given number of chars from a
@@ -1597,8 +1758,8 @@ void TestResult::RecordProperty(const TestProperty& test_property) {
property_with_matching_key.SetValue(test_property.value());
}
// Adds a failure if the key is a reserved attribute of Google Test testcase tags.
// Returns true if the property is valid.
// Adds a failure if the key is a reserved attribute of Google Test
// testcase tags. Returns true if the property is valid.
bool TestResult::ValidateTestProperty(const TestProperty& test_property) {
String key(test_property.key());
if (key == "name" || key == "status" || key == "time" || key == "classname") {
@@ -1850,13 +2011,17 @@ bool Test::HasFatalFailure() {
// class TestInfo
// Constructs a TestInfo object.
// Constructs a TestInfo object. It assumes ownership of the test factory
// object via impl_.
TestInfo::TestInfo(const char* test_case_name,
const char* name,
const char* test_case_comment,
const char* comment,
internal::TypeId fixture_class_id,
TestMaker maker) {
internal::TestFactoryBase* factory) {
impl_ = new internal::TestInfoImpl(this, test_case_name, name,
fixture_class_id, maker);
test_case_comment, comment,
fixture_class_id, factory);
}
// Destructs a TestInfo object.
@@ -1864,29 +2029,41 @@ TestInfo::~TestInfo() {
delete impl_;
}
// Creates a TestInfo object and registers it with the UnitTest
// singleton; returns the created object.
namespace internal {
// Creates a new TestInfo object and registers it with Google Test;
// returns the created object.
//
// Arguments:
//
// test_case_name: name of the test case
// name: name of the test
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
// maker: pointer to the function that creates a test object
TestInfo* TestInfo::MakeAndRegisterInstance(
const char* test_case_name,
const char* name,
internal::TypeId fixture_class_id,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
TestMaker maker) {
// test_case_name: name of the test case
// name: name of the test
// test_case_comment: a comment on the test case that will be included in
// the test output
// comment: a comment on the test that will be included in the
// test output
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
// factory: pointer to the factory that creates a test object.
// The newly created TestInfo instance will assume
// ownership of the factory object.
TestInfo* MakeAndRegisterTestInfo(
const char* test_case_name, const char* name,
const char* test_case_comment, const char* comment,
TypeId fixture_class_id,
SetUpTestCaseFunc set_up_tc,
TearDownTestCaseFunc tear_down_tc,
TestFactoryBase* factory) {
TestInfo* const test_info =
new TestInfo(test_case_name, name, fixture_class_id, maker);
internal::GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
new TestInfo(test_case_name, name, test_case_comment, comment,
fixture_class_id, factory);
GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
return test_info;
}
} // namespace internal
// Returns the test case name.
const char* TestInfo::test_case_name() const {
return impl_->test_case_name();
@@ -1897,6 +2074,16 @@ const char* TestInfo::name() const {
return impl_->name();
}
// Returns the test case comment.
const char* TestInfo::test_case_comment() const {
return impl_->test_case_comment();
}
// Returns the test comment.
const char* TestInfo::comment() const {
return impl_->comment();
}
// Returns true if this test should run.
bool TestInfo::should_run() const { return impl_->should_run(); }
@@ -1975,7 +2162,7 @@ void TestInfoImpl::Run() {
__try {
// Creates the test object.
test = (*maker_)();
test = factory_->CreateTest();
} __except(internal::UnitTestOptions::GTestShouldProcessSEH(
GetExceptionCode())) {
AddExceptionThrownFailure(GetExceptionCode(),
@@ -1990,7 +2177,7 @@ void TestInfoImpl::Run() {
// exception-safe.
// Creates the test object.
Test* test = (*maker_)();
Test* test = factory_->CreateTest();
#endif // GTEST_OS_WINDOWS
// Runs the test only if the constructor of the test fixture didn't
@@ -2049,10 +2236,11 @@ int TestCase::total_test_count() const {
// name: name of the test case
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
TestCase::TestCase(const char* name,
TestCase::TestCase(const char* name, const char* comment,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc)
: name_(name),
comment_(comment),
set_up_tc_(set_up_tc),
tear_down_tc_(tear_down_tc),
should_run_(false),
@@ -2149,7 +2337,11 @@ static const char * TestPartResultTypeToString(TestPartResultType type) {
case TPRT_NONFATAL_FAILURE:
case TPRT_FATAL_FAILURE:
return "Failure";
#ifdef _MSC_VER
return "error: ";
#else
return "Failure\n";
#endif
}
return "Unknown result type";
@@ -2158,14 +2350,11 @@ static const char * TestPartResultTypeToString(TestPartResultType type) {
// Prints a TestPartResult.
static void PrintTestPartResult(
const TestPartResult & test_part_result) {
const char * const file_name = test_part_result.file_name();
printf("%s", file_name == NULL ? "unknown file" : file_name);
if (test_part_result.line_number() >= 0) {
printf(":%d", test_part_result.line_number());
}
printf(": %s\n", TestPartResultTypeToString(test_part_result.type()));
printf("%s\n", test_part_result.message());
printf("%s %s%s\n",
internal::FormatFileLocation(test_part_result.file_name(),
test_part_result.line_number()).c_str(),
TestPartResultTypeToString(test_part_result.type()),
test_part_result.message());
fflush(stdout);
}
@@ -2179,7 +2368,7 @@ enum GTestColor {
COLOR_YELLOW
};
#ifdef _WIN32
#if defined(_WIN32) && !defined(_WIN32_WCE)
// Returns the character attribute for the given color.
WORD GetColorAttribute(GTestColor color) {
@@ -2203,7 +2392,7 @@ const char* GetAnsiColorCode(GTestColor color) {
return NULL;
}
#endif // _WIN32
#endif // _WIN32 && !_WIN32_WCE
// Returns true iff Google Test should use colors in the output.
bool ShouldUseColor(bool stdout_is_tty) {
@@ -2242,7 +2431,11 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
#ifdef _WIN32_WCE
static const bool use_color = false;
#else
static const bool use_color = ShouldUseColor(isatty(fileno(stdout)) != 0);
#endif // !_WIN32_WCE
// The '!= 0' comparison is necessary to satisfy MSVC 7.1.
if (!use_color) {
@@ -2251,7 +2444,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
return;
}
#ifdef _WIN32
#if defined(_WIN32) && !defined(_WIN32_WCE)
const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
// Gets the current text color.
@@ -2269,7 +2462,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
printf("\033[0;3%sm", GetAnsiColorCode(color));
vprintf(fmt, args);
printf("\033[m"); // Resets the terminal to default.
#endif // _WIN32
#endif // _WIN32 && !_WIN32_WCE
va_end(args);
}
@@ -2295,6 +2488,7 @@ class PrettyUnitTestResultPrinter : public UnitTestEventListenerInterface {
virtual void OnUnitTestStart(const UnitTest * unit_test);
virtual void OnGlobalSetUpStart(const UnitTest*);
virtual void OnTestCaseStart(const TestCase * test_case);
virtual void OnTestCaseEnd(const TestCase * test_case);
virtual void OnTestStart(const TestInfo * test_info);
virtual void OnNewTestPartResult(const TestPartResult * result);
virtual void OnTestEnd(const TestInfo * test_info);
@@ -2337,14 +2531,37 @@ void PrettyUnitTestResultPrinter::OnTestCaseStart(
const internal::String counts =
FormatCountableNoun(test_case->test_to_run_count(), "test", "tests");
ColoredPrintf(COLOR_GREEN, "[----------] ");
printf("%s from %s\n", counts.c_str(), test_case_name_.c_str());
printf("%s from %s", counts.c_str(), test_case_name_.c_str());
if (test_case->comment()[0] == '\0') {
printf("\n");
} else {
printf(", where %s\n", test_case->comment());
}
fflush(stdout);
}
void PrettyUnitTestResultPrinter::OnTestCaseEnd(
const TestCase * test_case) {
if (!GTEST_FLAG(print_time)) return;
test_case_name_ = test_case->name();
const internal::String counts =
FormatCountableNoun(test_case->test_to_run_count(), "test", "tests");
ColoredPrintf(COLOR_GREEN, "[----------] ");
printf("%s from %s (%s ms total)\n\n",
counts.c_str(), test_case_name_.c_str(),
internal::StreamableToString(test_case->elapsed_time()).c_str());
fflush(stdout);
}
void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo * test_info) {
ColoredPrintf(COLOR_GREEN, "[ RUN ] ");
PrintTestName(test_case_name_.c_str(), test_info->name());
printf("\n");
if (test_info->comment()[0] == '\0') {
printf("\n");
} else {
printf(", where %s\n", test_info->comment());
}
fflush(stdout);
}
@@ -2355,7 +2572,12 @@ void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo * test_info) {
ColoredPrintf(COLOR_RED, "[ FAILED ] ");
}
PrintTestName(test_case_name_.c_str(), test_info->name());
printf("\n");
if (GTEST_FLAG(print_time)) {
printf(" (%s ms)\n", internal::StreamableToString(
test_info->result()->elapsed_time()).c_str());
} else {
printf("\n");
}
fflush(stdout);
}
@@ -2400,7 +2622,16 @@ static void PrintFailedTestsPretty(const UnitTestImpl* impl) {
continue;
}
ColoredPrintf(COLOR_RED, "[ FAILED ] ");
printf("%s.%s\n", ti->test_case_name(), ti->name());
printf("%s.%s", ti->test_case_name(), ti->name());
if (ti->test_case_comment()[0] != '\0' ||
ti->comment()[0] != '\0') {
printf(", where %s", ti->test_case_comment());
if (ti->test_case_comment()[0] != '\0' &&
ti->comment()[0] != '\0') {
printf(" and ");
}
}
printf("%s\n", ti->comment());
}
}
}
@@ -2412,9 +2643,14 @@ void PrettyUnitTestResultPrinter::OnUnitTestEnd(
const internal::UnitTestImpl* const impl = unit_test->impl();
ColoredPrintf(COLOR_GREEN, "[==========] ");
printf("%s from %s ran.\n",
printf("%s from %s ran.",
FormatTestCount(impl->test_to_run_count()).c_str(),
FormatTestCaseCount(impl->test_case_to_run_count()).c_str());
if (GTEST_FLAG(print_time)) {
printf(" (%s ms total)",
internal::StreamableToString(impl->elapsed_time()).c_str());
}
printf("\n");
ColoredPrintf(COLOR_GREEN, "[ PASSED ] ");
printf("%s.\n", FormatTestCount(impl->successful_test_count()).c_str());
@@ -2976,6 +3212,12 @@ int UnitTest::Run() {
#endif // GTEST_OS_WINDOWS
}
// Returns the working directory when the first TEST() or TEST_F() was
// executed.
const char* UnitTest::original_working_dir() const {
return impl_->original_working_dir_.c_str();
}
// Returns the TestCase object for the test that's currently running,
// or NULL if no test is running.
// L < mutex_
@@ -3086,6 +3328,7 @@ class TestCaseNameIs {
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
const char* comment,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc) {
// Can we find a TestCase with the given name?
@@ -3095,10 +3338,11 @@ TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
if (node == NULL) {
// No. Let's create one.
TestCase* const test_case =
new TestCase(test_case_name, set_up_tc, tear_down_tc);
new TestCase(test_case_name, comment, set_up_tc, tear_down_tc);
// Is this a death test case?
if (String(test_case_name).EndsWith("DeathTest")) {
if (internal::UnitTestOptions::MatchesFilter(String(test_case_name),
kDeathTestCaseFilter)) {
// Yes. Inserts the test case after the last death test case
// defined so far.
node = test_cases_.InsertAfter(last_death_test_case_, test_case);
@@ -3231,12 +3475,12 @@ int UnitTestImpl::FilterTests() {
TestInfo * const test_info = test_info_node->element();
const String test_name(test_info->name());
// A test is disabled if test case name or test name matches
// kDisableTestPattern.
// kDisableTestFilter.
const bool is_disabled =
internal::UnitTestOptions::PatternMatchesString(kDisableTestPattern,
test_case_name.c_str()) ||
internal::UnitTestOptions::PatternMatchesString(kDisableTestPattern,
test_name.c_str());
internal::UnitTestOptions::MatchesFilter(test_case_name,
kDisableTestFilter) ||
internal::UnitTestOptions::MatchesFilter(test_name,
kDisableTestFilter);
test_info->impl()->set_is_disabled(is_disabled);
const bool should_run = !is_disabled &&
@@ -3348,23 +3592,29 @@ internal::TestResult* UnitTestImpl::current_test_result() {
current_test_info_->impl()->result() : &ad_hoc_test_result_;
}
// TestInfoImpl constructor.
// TestInfoImpl constructor. The new instance assumes ownership of the test
// factory opbject.
TestInfoImpl::TestInfoImpl(TestInfo* parent,
const char* test_case_name,
const char* name,
const char* test_case_comment,
const char* comment,
TypeId fixture_class_id,
TestMaker maker) :
internal::TestFactoryBase* factory) :
parent_(parent),
test_case_name_(String(test_case_name)),
name_(String(name)),
test_case_comment_(String(test_case_comment)),
comment_(String(comment)),
fixture_class_id_(fixture_class_id),
should_run_(false),
is_disabled_(false),
maker_(maker) {
factory_(factory) {
}
// TestInfoImpl destructor.
TestInfoImpl::~TestInfoImpl() {
delete factory_;
}
} // namespace internal
@@ -3497,6 +3747,7 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
&GTEST_FLAG(internal_run_death_test)) ||
ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat))
) {
// Yes. Shift the remainder of the argv list left by one. Note
+64 -55
View File
@@ -36,6 +36,8 @@
#ifdef GTEST_HAS_DEATH_TEST
#include <stdio.h>
#include <unistd.h>
#include <gtest/gtest-spi.h>
// Indicates that this translation unit is part of Google Test's
@@ -85,13 +87,19 @@ class TestForDeathTest : public testing::Test {
protected:
// A static member function that's expected to die.
static void StaticMemberFunction() {
GTEST_LOG(FATAL, "death inside StaticMemberFunction().");
fprintf(stderr, "%s", "death inside StaticMemberFunction().");
// We call _exit() instead of exit(), as the former is a direct
// system call and thus safer in the presence of threads. exit()
// will invoke user-defined exit-hooks, which may do dangerous
// things that conflict with death tests.
_exit(1);
}
// A method of the test fixture that may die.
void MemberFunction() {
if (should_die_) {
GTEST_LOG(FATAL, "death inside MemberFunction().");
fprintf(stderr, "%s", "death inside MemberFunction().");
_exit(1);
}
}
@@ -157,13 +165,13 @@ int DieInDebugElse12(int* sideeffect) {
return 12;
}
// Returns the exit status of a process that calls exit(2) with a
// Returns the exit status of a process that calls _exit(2) with a
// given exit code. This is a helper function for the
// ExitStatusPredicateTest test suite.
static int NormalExitStatus(int exit_code) {
pid_t child_pid = fork();
if (child_pid == 0) {
exit(exit_code);
_exit(exit_code);
}
int status;
waitpid(child_pid, &status, 0);
@@ -179,7 +187,7 @@ static int KilledExitStatus(int signum) {
pid_t child_pid = fork();
if (child_pid == 0) {
raise(signum);
exit(1);
_exit(1);
}
int status;
waitpid(child_pid, &status, 0);
@@ -223,7 +231,7 @@ TEST_F(TestForDeathTest, SingleStatement) {
ASSERT_DEATH(return, "");
if (true)
EXPECT_DEATH(exit(1), "");
EXPECT_DEATH(_exit(1), "");
else
// This empty "else" branch is meant to ensure that EXPECT_DEATH
// doesn't expand into an "if" statement without an "else"
@@ -235,12 +243,12 @@ TEST_F(TestForDeathTest, SingleStatement) {
if (false)
;
else
EXPECT_DEATH(exit(1), "") << 1 << 2 << 3;
EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
}
void DieWithEmbeddedNul() {
fprintf(stderr, "Hello%cworld.\n", '\0');
abort();
_exit(1);
}
// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
@@ -257,24 +265,40 @@ TEST_F(TestForDeathTest, DISABLED_EmbeddedNulInMessage) {
TEST_F(TestForDeathTest, SwitchStatement) {
switch (0)
default:
ASSERT_DEATH(exit(1), "") << "exit in default switch handler";
ASSERT_DEATH(_exit(1), "") << "exit in default switch handler";
switch (0)
case 0:
EXPECT_DEATH(exit(1), "") << "exit in switch case";
EXPECT_DEATH(_exit(1), "") << "exit in switch case";
}
// Tests that a static member function can be used in a death test.
TEST_F(TestForDeathTest, StaticMemberFunction) {
// Tests that a static member function can be used in a "fast" style
// death test.
TEST_F(TestForDeathTest, StaticMemberFunctionFastStyle) {
testing::GTEST_FLAG(death_test_style) = "fast";
ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
}
// Tests that a method of the test fixture can be used in a death test.
TEST_F(TestForDeathTest, MemberFunction) {
// Tests that a method of the test fixture can be used in a "fast"
// style death test.
TEST_F(TestForDeathTest, MemberFunctionFastStyle) {
testing::GTEST_FLAG(death_test_style) = "fast";
should_die_ = true;
EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
}
// Tests that death tests work even if the current directory has been
// changed.
TEST_F(TestForDeathTest, FastDeathTestInChangedDir) {
testing::GTEST_FLAG(death_test_style) = "fast";
chdir("/");
EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
chdir("/");
ASSERT_DEATH(_exit(1), "");
}
// Repeats a representative sample of death tests in the "threadsafe" style:
TEST_F(TestForDeathTest, StaticMemberFunctionThreadsafeStyle) {
@@ -292,14 +316,24 @@ TEST_F(TestForDeathTest, ThreadsafeDeathTestInLoop) {
testing::GTEST_FLAG(death_test_style) = "threadsafe";
for (int i = 0; i < 3; ++i)
EXPECT_EXIT(exit(i), testing::ExitedWithCode(i), "") << ": i = " << i;
EXPECT_EXIT(_exit(i), testing::ExitedWithCode(i), "") << ": i = " << i;
}
TEST_F(TestForDeathTest, ThreadsafeDeathTestInChangedDir) {
testing::GTEST_FLAG(death_test_style) = "threadsafe";
chdir("/");
EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
chdir("/");
ASSERT_DEATH(_exit(1), "");
}
TEST_F(TestForDeathTest, MixedStyles) {
testing::GTEST_FLAG(death_test_style) = "threadsafe";
EXPECT_DEATH(exit(1), "");
EXPECT_DEATH(_exit(1), "");
testing::GTEST_FLAG(death_test_style) = "fast";
EXPECT_DEATH(exit(1), "");
EXPECT_DEATH(_exit(1), "");
}
namespace {
@@ -316,7 +350,7 @@ TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) {
testing::GTEST_FLAG(death_test_style) = "threadsafe";
pthread_flag = false;
ASSERT_EQ(0, pthread_atfork(&SetPthreadFlag, NULL, NULL));
ASSERT_DEATH(exit(1), "");
ASSERT_DEATH(_exit(1), "");
ASSERT_FALSE(pthread_flag);
}
@@ -467,31 +501,6 @@ TEST_F(TestForDeathTest, TestExpectDebugDeath) {
#endif
}
// Tests that EXPECT_DEBUG_DEATH works as expected,
// that is, in debug mode, it:
// 1. Asserts on death.
// 2. Has no side effect.
//
// And in opt mode, it:
// 1. Has side effects and returns the expected value (12).
TEST_F(TestForDeathTest, TestExpectDebugDeathM) {
int sideeffect = 0;
EXPECT_DEBUG_DEATH({ // NOLINT
// Tests that the return value is 12 in opt mode.
EXPECT_EQ(12, DieInDebugElse12(&sideeffect));
// Tests that the side effect occurrs in opt mode.
EXPECT_EQ(12, sideeffect);
}, "death.*DieInDebugElse12") << "In ExpectDebugDeathM";
#ifdef NDEBUG
// Checks that the assignment occurs in opt mode (sideeffect).
EXPECT_EQ(12, sideeffect);
#else
// Checks that the assignment does not occur in dbg mode (no sideeffect).
EXPECT_EQ(0, sideeffect);
#endif
}
// Tests that ASSERT_DEBUG_DEATH works as expected
// In debug mode:
// 1. Asserts on debug death.
@@ -499,7 +508,7 @@ TEST_F(TestForDeathTest, TestExpectDebugDeathM) {
//
// In opt mode:
// 1. Has side effects and returns the expected value (12).
TEST_F(TestForDeathTest, TestAssertDebugDeathM) {
TEST_F(TestForDeathTest, TestAssertDebugDeath) {
int sideeffect = 0;
ASSERT_DEBUG_DEATH({ // NOLINT
@@ -507,7 +516,7 @@ TEST_F(TestForDeathTest, TestAssertDebugDeathM) {
EXPECT_EQ(12, DieInDebugElse12(&sideeffect));
// Tests that the side effect occurred in opt mode.
EXPECT_EQ(12, sideeffect);
}, "death.*DieInDebugElse12") << "In AssertDebugDeathM";
}, "death.*DieInDebugElse12");
#ifdef NDEBUG
// Checks that the assignment occurs in opt mode (sideeffect).
@@ -553,8 +562,8 @@ TEST_F(TestForDeathTest, AssertDebugDeathAborts) {
// Tests the *_EXIT family of macros, using a variety of predicates.
TEST_F(TestForDeathTest, ExitMacros) {
EXPECT_EXIT(exit(1), testing::ExitedWithCode(1), "");
ASSERT_EXIT(exit(42), testing::ExitedWithCode(42), "");
EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), "");
EXPECT_EXIT(raise(SIGKILL), testing::KilledBySignal(SIGKILL), "") << "foo";
ASSERT_EXIT(raise(SIGUSR2), testing::KilledBySignal(SIGUSR2), "") << "bar";
@@ -564,7 +573,7 @@ TEST_F(TestForDeathTest, ExitMacros) {
}, "This failure is expected.");
EXPECT_FATAL_FAILURE({ // NOLINT
ASSERT_EXIT(exit(0), testing::KilledBySignal(SIGSEGV), "")
ASSERT_EXIT(_exit(0), testing::KilledBySignal(SIGSEGV), "")
<< "This failure is expected, too.";
}, "This failure is expected, too.");
}
@@ -572,7 +581,7 @@ TEST_F(TestForDeathTest, ExitMacros) {
TEST_F(TestForDeathTest, InvalidStyle) {
testing::GTEST_FLAG(death_test_style) = "rococo";
EXPECT_NONFATAL_FAILURE({ // NOLINT
EXPECT_DEATH(exit(0), "") << "This failure is expected.";
EXPECT_DEATH(_exit(0), "") << "This failure is expected.";
}, "This failure is expected.");
}
@@ -819,7 +828,7 @@ TEST_F(MacroLogicDeathTest, ChildDoesNotDie) {
// This time there are two calls to Abort: one since the test didn't
// die, and another from the ReturnSentinel when it's destroyed. The
// sentinel normally isn't destroyed if a test doesn't die, since
// exit(2) is called in that case by ForkingDeathTest, but not by
// _exit(2) is called in that case by ForkingDeathTest, but not by
// our MockDeathTest.
ASSERT_EQ(2, factory_->AbortCalls());
EXPECT_EQ(DeathTest::TEST_DID_NOT_DIE,
@@ -838,18 +847,18 @@ static size_t GetSuccessfulTestPartCount() {
// Tests that a successful death test does not register a successful
// test part.
TEST(SuccessRegistrationDeathTest, NoSuccessPart) {
EXPECT_DEATH(exit(1), "");
EXPECT_DEATH(_exit(1), "");
EXPECT_EQ(0u, GetSuccessfulTestPartCount());
}
TEST(StreamingAssertionsDeathTest, DeathTest) {
EXPECT_DEATH(exit(1), "") << "unexpected failure";
ASSERT_DEATH(exit(1), "") << "unexpected failure";
EXPECT_DEATH(_exit(1), "") << "unexpected failure";
ASSERT_DEATH(_exit(1), "") << "unexpected failure";
EXPECT_NONFATAL_FAILURE({ // NOLINT
EXPECT_DEATH(exit(0), "") << "expected failure";
EXPECT_DEATH(_exit(0), "") << "expected failure";
}, "expected failure");
EXPECT_FATAL_FAILURE({ // NOLINT
ASSERT_DEATH(exit(0), "") << "expected failure";
ASSERT_DEATH(_exit(0), "") << "expected failure";
}, "expected failure");
}
+68
View File
@@ -51,7 +51,11 @@
#undef GTEST_IMPLEMENTATION
#ifdef GTEST_OS_WINDOWS
#ifdef _WIN32_WCE
#include <windows.h>
#else
#include <direct.h>
#endif // _WIN32_WCE
#define PATH_SEP "\\"
#else
#define PATH_SEP "/"
@@ -61,6 +65,64 @@ namespace testing {
namespace internal {
namespace {
#ifdef _WIN32_WCE
// Windows CE doesn't have the remove C function.
int remove(const char* path) {
LPCWSTR wpath = String::AnsiToUtf16(path);
int ret = DeleteFile(wpath) ? 0 : -1;
delete [] wpath;
return ret;
}
// Windows CE doesn't have the _rmdir C function.
int _rmdir(const char* path) {
FilePath filepath(path);
LPCWSTR wpath = String::AnsiToUtf16(
filepath.RemoveTrailingPathSeparator().c_str());
int ret = RemoveDirectory(wpath) ? 0 : -1;
delete [] wpath;
return ret;
}
#elif defined(GTEST_LINUX_GOOGLE3_MODE)
// Creates a temporary directory and returns its path.
const char* MakeTempDir() {
static char dir_name[] = "gtest-filepath_test_tmpXXXXXX";
return mkdtemp(dir_name);
}
#endif // _WIN32_WCE
#ifndef _WIN32_WCE
TEST(GetCurrentDirTest, ReturnsCurrentDir) {
EXPECT_FALSE(FilePath::GetCurrentDir().IsEmpty());
#ifdef GTEST_OS_WINDOWS
_chdir(PATH_SEP);
const FilePath cwd = FilePath::GetCurrentDir();
// Skips the ":".
const char* const cwd_without_drive = strchr(cwd.c_str(), ':');
ASSERT_TRUE(cwd_without_drive != NULL);
EXPECT_STREQ(PATH_SEP, cwd_without_drive + 1);
#else
chdir(PATH_SEP);
EXPECT_STREQ(PATH_SEP, FilePath::GetCurrentDir().c_str());
#endif
}
#endif // _WIN32_WCE
TEST(IsEmptyTest, ReturnsTrueForEmptyPath) {
EXPECT_TRUE(FilePath("").IsEmpty());
EXPECT_TRUE(FilePath(NULL).IsEmpty());
}
TEST(IsEmptyTest, ReturnsFalseForNonEmptyPath) {
EXPECT_FALSE(FilePath("a").IsEmpty());
EXPECT_FALSE(FilePath(".").IsEmpty());
EXPECT_FALSE(FilePath("a/b").IsEmpty());
EXPECT_FALSE(FilePath("a\\b\\").IsEmpty());
}
// FilePath's functions used by UnitTestOptions::GetOutputFile.
// RemoveDirectoryName "" -> ""
@@ -102,8 +164,14 @@ TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileName) {
// RemoveFileName "" -> "./"
TEST(RemoveFileNameTest, EmptyName) {
#ifdef _WIN32_WCE
// On Windows CE, we use the root as the current directory.
EXPECT_STREQ(PATH_SEP,
FilePath("").RemoveFileName().c_str());
#else
EXPECT_STREQ("." PATH_SEP,
FilePath("").RemoveFileName().c_str());
#endif
}
// RemoveFileName "adir/" -> "adir/"
+45
View File
@@ -0,0 +1,45 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include <vector>
#include "test/gtest-typed-test_test.h"
#include <gtest/gtest.h>
#ifdef GTEST_HAS_TYPED_TEST_P
// Tests that the same type-parameterized test case can be
// instantiated in different translation units linked together.
// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest,
testing::Types<std::vector<int> >);
#endif // GTEST_HAS_TYPED_TEST_P
+350
View File
@@ -0,0 +1,350 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include <list>
#include <set>
#include "test/gtest-typed-test_test.h"
#include <gtest/gtest.h>
using testing::Test;
// Used for testing that SetUpTestCase()/TearDownTestCase(), fixture
// ctor/dtor, and SetUp()/TearDown() work correctly in typed tests and
// type-parameterized test.
template <typename T>
class CommonTest : public Test {
// For some technical reason, SetUpTestCase() and TearDownTestCase()
// must be public.
public:
static void SetUpTestCase() {
shared_ = new T(5);
}
static void TearDownTestCase() {
delete shared_;
shared_ = NULL;
}
// This 'protected:' is optional. There's no harm in making all
// members of this fixture class template public.
protected:
typedef std::list<T> List;
typedef std::set<int> IntSet;
CommonTest() : value_(1) {}
virtual ~CommonTest() { EXPECT_EQ(3, value_); }
virtual void SetUp() {
EXPECT_EQ(1, value_);
value_++;
}
virtual void TearDown() {
EXPECT_EQ(2, value_);
value_++;
}
T value_;
static T* shared_;
};
template <typename T>
T* CommonTest<T>::shared_ = NULL;
// This #ifdef block tests typed tests.
#ifdef GTEST_HAS_TYPED_TEST
using testing::Types;
// Tests that SetUpTestCase()/TearDownTestCase(), fixture ctor/dtor,
// and SetUp()/TearDown() work correctly in typed tests
typedef Types<char, int> TwoTypes;
TYPED_TEST_CASE(CommonTest, TwoTypes);
TYPED_TEST(CommonTest, ValuesAreCorrect) {
// Static members of the fixture class template can be visited via
// the TestFixture:: prefix.
EXPECT_EQ(5, *TestFixture::shared_);
// Typedefs in the fixture class template can be visited via the
// "typename TestFixture::" prefix.
typename TestFixture::List empty;
EXPECT_EQ(0, empty.size());
typename TestFixture::IntSet empty2;
EXPECT_EQ(0, empty2.size());
// Non-static members of the fixture class must be visited via
// 'this', as required by C++ for class templates.
EXPECT_EQ(2, this->value_);
}
// The second test makes sure shared_ is not deleted after the first
// test.
TYPED_TEST(CommonTest, ValuesAreStillCorrect) {
// Static members of the fixture class template can also be visited
// via 'this'.
ASSERT_TRUE(this->shared_ != NULL);
EXPECT_EQ(5, *this->shared_);
// TypeParam can be used to refer to the type parameter.
EXPECT_EQ(static_cast<TypeParam>(2), this->value_);
}
// Tests that multiple TYPED_TEST_CASE's can be defined in the same
// translation unit.
template <typename T>
class TypedTest1 : public Test {
};
// Verifies that the second argument of TYPED_TEST_CASE can be a
// single type.
TYPED_TEST_CASE(TypedTest1, int);
TYPED_TEST(TypedTest1, A) {}
template <typename T>
class TypedTest2 : public Test {
};
// Verifies that the second argument of TYPED_TEST_CASE can be a
// Types<...> type list.
TYPED_TEST_CASE(TypedTest2, Types<int>);
// This also verifies that tests from different typed test cases can
// share the same name.
TYPED_TEST(TypedTest2, A) {}
// Tests that a typed test case can be defined in a namespace.
namespace library1 {
template <typename T>
class NumericTest : public Test {
};
typedef Types<int, long> NumericTypes;
TYPED_TEST_CASE(NumericTest, NumericTypes);
TYPED_TEST(NumericTest, DefaultIsZero) {
EXPECT_EQ(0, TypeParam());
}
} // namespace library1
#endif // GTEST_HAS_TYPED_TEST
// This #ifdef block tests type-parameterized tests.
#ifdef GTEST_HAS_TYPED_TEST_P
using testing::Types;
using testing::internal::TypedTestCasePState;
// Tests TypedTestCasePState.
class TypedTestCasePStateTest : public Test {
protected:
virtual void SetUp() {
state_.AddTestName("foo.cc", 0, "FooTest", "A");
state_.AddTestName("foo.cc", 0, "FooTest", "B");
state_.AddTestName("foo.cc", 0, "FooTest", "C");
}
TypedTestCasePState state_;
};
TEST_F(TypedTestCasePStateTest, SucceedsForMatchingList) {
const char* tests = "A, B, C";
EXPECT_EQ(tests,
state_.VerifyRegisteredTestNames("foo.cc", 1, tests));
}
// Makes sure that the order of the tests and spaces around the names
// don't matter.
TEST_F(TypedTestCasePStateTest, IgnoresOrderAndSpaces) {
const char* tests = "A,C, B";
EXPECT_EQ(tests,
state_.VerifyRegisteredTestNames("foo.cc", 1, tests));
}
#ifdef GTEST_HAS_DEATH_TEST
typedef TypedTestCasePStateTest TypedTestCasePStateDeathTest;
TEST_F(TypedTestCasePStateDeathTest, DetectsDuplicates) {
EXPECT_DEATH(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, A, C"),
"foo\\.cc:1: Test A is listed more than once\\.");
}
TEST_F(TypedTestCasePStateDeathTest, DetectsExtraTest) {
EXPECT_DEATH(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C, D"),
"foo\\.cc:1: No test named D can be found in this test case\\.");
}
TEST_F(TypedTestCasePStateDeathTest, DetectsMissedTest) {
EXPECT_DEATH(
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, C"),
"foo\\.cc:1: You forgot to list test B\\.");
}
// Tests that defining a test for a parameterized test case generates
// a run-time error if the test case has been registered.
TEST_F(TypedTestCasePStateDeathTest, DetectsTestAfterRegistration) {
state_.VerifyRegisteredTestNames("foo.cc", 1, "A, B, C");
EXPECT_DEATH(
state_.AddTestName("foo.cc", 2, "FooTest", "D"),
"foo\\.cc:2: Test D must be defined before REGISTER_TYPED_TEST_CASE_P"
"\\(FooTest, \\.\\.\\.\\)\\.");
}
#endif // GTEST_HAS_DEATH_TEST
// Tests that SetUpTestCase()/TearDownTestCase(), fixture ctor/dtor,
// and SetUp()/TearDown() work correctly in type-parameterized tests.
template <typename T>
class DerivedTest : public CommonTest<T> {
};
TYPED_TEST_CASE_P(DerivedTest);
TYPED_TEST_P(DerivedTest, ValuesAreCorrect) {
// Static members of the fixture class template can be visited via
// the TestFixture:: prefix.
EXPECT_EQ(5, *TestFixture::shared_);
// Non-static members of the fixture class must be visited via
// 'this', as required by C++ for class templates.
EXPECT_EQ(2, this->value_);
}
// The second test makes sure shared_ is not deleted after the first
// test.
TYPED_TEST_P(DerivedTest, ValuesAreStillCorrect) {
// Static members of the fixture class template can also be visited
// via 'this'.
ASSERT_TRUE(this->shared_ != NULL);
EXPECT_EQ(5, *this->shared_);
EXPECT_EQ(2, this->value_);
}
REGISTER_TYPED_TEST_CASE_P(DerivedTest,
ValuesAreCorrect, ValuesAreStillCorrect);
typedef Types<short, long> MyTwoTypes;
INSTANTIATE_TYPED_TEST_CASE_P(My, DerivedTest, MyTwoTypes);
// Tests that multiple TYPED_TEST_CASE_P's can be defined in the same
// translation unit.
template <typename T>
class TypedTestP1 : public Test {
};
TYPED_TEST_CASE_P(TypedTestP1);
// For testing that the code between TYPED_TEST_CASE_P() and
// TYPED_TEST_P() is not enclosed in a namespace.
typedef int IntAfterTypedTestCaseP;
TYPED_TEST_P(TypedTestP1, A) {}
TYPED_TEST_P(TypedTestP1, B) {}
// For testing that the code between TYPED_TEST_P() and
// REGISTER_TYPED_TEST_CASE_P() is not enclosed in a namespace.
typedef int IntBeforeRegisterTypedTestCaseP;
REGISTER_TYPED_TEST_CASE_P(TypedTestP1, A, B);
template <typename T>
class TypedTestP2 : public Test {
};
TYPED_TEST_CASE_P(TypedTestP2);
// This also verifies that tests from different type-parameterized
// test cases can share the same name.
TYPED_TEST_P(TypedTestP2, A) {}
REGISTER_TYPED_TEST_CASE_P(TypedTestP2, A);
// Verifies that the code between TYPED_TEST_CASE_P() and
// REGISTER_TYPED_TEST_CASE_P() is not enclosed in a namespace.
IntAfterTypedTestCaseP after = 0;
IntBeforeRegisterTypedTestCaseP before = 0;
// Verifies that the last argument of INSTANTIATE_TYPED_TEST_CASE_P()
// can be either a single type or a Types<...> type list.
INSTANTIATE_TYPED_TEST_CASE_P(Int, TypedTestP1, int);
INSTANTIATE_TYPED_TEST_CASE_P(Int, TypedTestP2, Types<int>);
// Tests that the same type-parameterized test case can be
// instantiated more than once in the same translation unit.
INSTANTIATE_TYPED_TEST_CASE_P(Double, TypedTestP2, Types<double>);
// Tests that the same type-parameterized test case can be
// instantiated in different translation units linked together.
// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
typedef Types<std::list<double>, std::set<char> > MyContainers;
INSTANTIATE_TYPED_TEST_CASE_P(My, ContainerTest, MyContainers);
// Tests that a type-parameterized test case can be defined and
// instantiated in a namespace.
namespace library2 {
template <typename T>
class NumericTest : public Test {
};
TYPED_TEST_CASE_P(NumericTest);
TYPED_TEST_P(NumericTest, DefaultIsZero) {
EXPECT_EQ(0, TypeParam());
}
TYPED_TEST_P(NumericTest, ZeroIsLessThanOne) {
EXPECT_LT(TypeParam(0), TypeParam(1));
}
REGISTER_TYPED_TEST_CASE_P(NumericTest,
DefaultIsZero, ZeroIsLessThanOne);
typedef Types<int, double> NumericTypes;
INSTANTIATE_TYPED_TEST_CASE_P(My, NumericTest, NumericTypes);
} // namespace library2
#endif // GTEST_HAS_TYPED_TEST_P
+66
View File
@@ -0,0 +1,66 @@
// Copyright 2008 Google Inc.
// All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#include <gtest/gtest.h>
#ifdef GTEST_HAS_TYPED_TEST_P
using testing::Test;
// For testing that the same type-parameterized test case can be
// instantiated in different translation units linked together.
// ContainerTest will be instantiated in both gtest-typed-test_test.cc
// and gtest-typed-test2_test.cc.
template <typename T>
class ContainerTest : public Test {
};
TYPED_TEST_CASE_P(ContainerTest);
TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) {
TypeParam container;
}
TYPED_TEST_P(ContainerTest, InitialSizeIsZero) {
TypeParam container;
EXPECT_EQ(0, container.size());
}
REGISTER_TYPED_TEST_CASE_P(ContainerTest,
CanBeDefaultConstructed, InitialSizeIsZero);
#endif // GTEST_HAS_TYPED_TEST_P
#endif // GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
+3 -2
View File
@@ -74,10 +74,11 @@ def SetEnvVar(env_var, value):
def Run(command):
"""Runs a command; returns 1 if it has a segmentation fault, or 0 otherwise.
"""Runs a command; returns 1 if it was killed by a signal, or 0 otherwise.
"""
return os.system(command) == signal.SIGSEGV
exit_code = os.system(command)
return os.WIFSIGNALED(exit_code)
# The unit test.
+1 -1
View File
@@ -62,7 +62,7 @@ def UsesColor(term, color_env_var, color_flag):
cmd = COMMAND
if color_flag is not None:
cmd += ' --%s=%s' % (COLOR_FLAG, color_flag)
return os.system(cmd)
return gtest_test_utils.GetExitStatus(os.system(cmd))
class GTestColorTest(unittest.TestCase):
+1
View File
@@ -101,6 +101,7 @@ def TestEnvVarAffectsFlag(command):
TestFlag(command, 'color', 'yes', 'auto')
TestFlag(command, 'filter', 'FooTest.Bar', '*')
TestFlag(command, 'output', 'tmp/foo.xml', '')
TestFlag(command, 'print_time', '1', '0')
TestFlag(command, 'repeat', '999', '1')
if IS_WINDOWS:
+5
View File
@@ -81,6 +81,11 @@ void PrintFlag(const char* flag) {
return;
}
if (strcmp(flag, "print_time") == 0) {
cout << GTEST_FLAG(print_time);
return;
}
if (strcmp(flag, "repeat") == 0) {
cout << GTEST_FLAG(repeat);
return;
+78
View File
@@ -103,6 +103,84 @@ class MyEnvironment : public testing::Environment {
}
};
#elif defined(TEST_CATCHES_WRONG_CASE_IN_TYPED_TEST_P)
// Tests that the compiler catches using the wrong test case name in
// TYPED_TEST_P.
#include <gtest/gtest.h>
template <typename T>
class FooTest : public testing::Test {
};
template <typename T>
class BarTest : public testing::Test {
};
TYPED_TEST_CASE_P(FooTest);
TYPED_TEST_P(BarTest, A) {} // Wrong test case name.
REGISTER_TYPED_TEST_CASE_P(FooTest, A);
INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, testing::Types<int>);
#elif defined(TEST_CATCHES_WRONG_CASE_IN_REGISTER_TYPED_TEST_CASE_P)
// Tests that the compiler catches using the wrong test case name in
// REGISTER_TYPED_TEST_CASE_P.
#include <gtest/gtest.h>
template <typename T>
class FooTest : public testing::Test {
};
template <typename T>
class BarTest : public testing::Test {
};
TYPED_TEST_CASE_P(FooTest);
TYPED_TEST_P(FooTest, A) {}
REGISTER_TYPED_TEST_CASE_P(BarTest, A); // Wrong test case name.
INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, testing::Types<int>);
#elif defined(TEST_CATCHES_WRONG_CASE_IN_INSTANTIATE_TYPED_TEST_CASE_P)
// Tests that the compiler catches using the wrong test case name in
// INSTANTIATE_TYPED_TEST_CASE_P.
#include <gtest/gtest.h>
template <typename T>
class FooTest : public testing::Test {
};
template <typename T>
class BarTest : public testing::Test {
};
TYPED_TEST_CASE_P(FooTest);
TYPED_TEST_P(FooTest, A) {}
REGISTER_TYPED_TEST_CASE_P(FooTest, A);
// Wrong test case name.
INSTANTIATE_TYPED_TEST_CASE_P(My, BarTest, testing::Types<int>);
#elif defined(TEST_CATCHES_INSTANTIATE_TYPED_TESET_CASE_P_WITH_SAME_NAME_PREFIX)
// Tests that the compiler catches instantiating TYPED_TEST_CASE_P
// twice with the same name prefix.
#include <gtest/gtest.h>
template <typename T>
class FooTest : public testing::Test {
};
TYPED_TEST_CASE_P(FooTest);
TYPED_TEST_P(FooTest, A) {}
REGISTER_TYPED_TEST_CASE_P(FooTest, A);
INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, testing::Types<int>);
// Wrong name prefix: "My" has been used.
INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, testing::Types<double>);
#else
// A sanity test. This should compile.
+12
View File
@@ -66,6 +66,18 @@ class GTestNCTest(unittest.TestCase):
('CATCHES_CALLING_SETUP_IN_ENVIRONMENT_WITH_TYPO',
[r'Setup_should_be_spelled_SetUp']),
('CATCHES_WRONG_CASE_IN_TYPED_TEST_P',
[r'BarTest.*was not declared']),
('CATCHES_WRONG_CASE_IN_REGISTER_TYPED_TEST_CASE_P',
[r'BarTest.*was not declared']),
('CATCHES_WRONG_CASE_IN_INSTANTIATE_TYPED_TEST_CASE_P',
[r'BarTest.*not declared']),
('CATCHES_INSTANTIATE_TYPED_TESET_CASE_P_WITH_SAME_NAME_PREFIX',
[r'redefinition of.*My.*FooTest']),
('SANITY',
None)
]
+40 -9
View File
@@ -32,6 +32,8 @@
"""Tests the text output of Google C++ Testing Framework.
SYNOPSIS
gtest_output_test.py --gtest_build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest_output_test_ file.
gtest_output_test.py --gengolden
gtest_output_test.py
"""
@@ -58,8 +60,10 @@ else:
PROGRAM = 'gtest_output_test_'
GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
COMMAND = os.path.join(gtest_test_utils.GetBuildDir(),
PROGRAM) + ' --gtest_color=yes'
PROGRAM_PATH = os.path.join(gtest_test_utils.GetBuildDir(), PROGRAM)
COMMAND_WITH_COLOR = PROGRAM_PATH + ' --gtest_color=yes'
COMMAND_WITH_TIME = (PROGRAM_PATH + ' --gtest_print_time '
+ '--gtest_filter="FatalFailureTest.*:LoggingTest.*"')
GOLDEN_PATH = os.path.join(gtest_test_utils.GetSourceDir(),
GOLDEN_NAME)
@@ -78,11 +82,12 @@ def RemoveLocations(output):
Returns:
output with all file location info (in the form of
'DIRECTORY/FILE_NAME:LINE_NUMBER: ') replaced by
'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
'FILE_NAME:#: '.
"""
return re.sub(r'.*[/\\](.+)\:\d+\: ', r'\1:#: ', output)
return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\: ', r'\1:#: ', output)
def RemoveStackTraces(output):
@@ -93,12 +98,33 @@ def RemoveStackTraces(output):
'Stack trace: (omitted)\n\n', output)
def RemoveTime(output):
"""Removes all time information from a Google Test program's output."""
return re.sub(r'\(\d+ ms', '(? ms', output)
def RemoveTestCounts(output):
"""Removes test counts from a Google Test program's output."""
output = re.sub(r'\d+ tests from \d+ test cases',
'? tests from ? test cases', output)
return re.sub(r'\d+ tests\.', '? tests.', output)
def RemoveDeathTests(output):
"""Removes death test information from a Google Test program's output."""
return re.sub(r'\n.*DeathTest.*', '', output)
def NormalizeOutput(output):
"""Normalizes output (the output of gtest_output_test_.exe)."""
output = ToUnixLineEnding(output)
output = RemoveLocations(output)
output = RemoveStackTraces(output)
output = RemoveTime(output)
return output
@@ -158,24 +184,29 @@ def GetCommandOutput(cmd):
"""
# Disables exception pop-ups on Windows.
os.environ['GUNIT_CATCH_EXCEPTIONS'] = '1'
os.environ['GTEST_CATCH_EXCEPTIONS'] = '1'
return NormalizeOutput(GetShellCommandOutput(cmd, ''))
class GTestOutputTest(unittest.TestCase):
def testOutput(self):
output = GetCommandOutput(COMMAND)
output = (GetCommandOutput(COMMAND_WITH_COLOR) +
GetCommandOutput(COMMAND_WITH_TIME))
golden_file = open(GOLDEN_PATH, 'rb')
golden = golden_file.read()
golden_file.close()
self.assertEquals(golden, output)
# We want the test to pass regardless of death tests being
# supported or not.
self.assert_(output == golden or
RemoveTestCounts(output) ==
RemoveTestCounts(RemoveDeathTests(golden)))
if __name__ == '__main__':
if sys.argv[1:] == [GENGOLDEN_FLAG]:
output = GetCommandOutput(COMMAND)
output = (GetCommandOutput(COMMAND_WITH_COLOR) +
GetCommandOutput(COMMAND_WITH_TIME))
golden_file = open(GOLDEN_PATH, 'wb')
golden_file.write(output)
golden_file.close()
+91
View File
@@ -699,6 +699,97 @@ TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
#endif // GTEST_HAS_EXCEPTIONS
// This #ifdef block tests the output of typed tests.
#ifdef GTEST_HAS_TYPED_TEST
template <typename T>
class TypedTest : public testing::Test {
};
TYPED_TEST_CASE(TypedTest, testing::Types<int>);
TYPED_TEST(TypedTest, Success) {
EXPECT_EQ(0, TypeParam());
}
TYPED_TEST(TypedTest, Failure) {
EXPECT_EQ(1, TypeParam()) << "Expected failure";
}
#endif // GTEST_HAS_TYPED_TEST
// This #ifdef block tests the output of type-parameterized tests.
#ifdef GTEST_HAS_TYPED_TEST_P
template <typename T>
class TypedTestP : public testing::Test {
};
TYPED_TEST_CASE_P(TypedTestP);
TYPED_TEST_P(TypedTestP, Success) {
EXPECT_EQ(0, TypeParam());
}
TYPED_TEST_P(TypedTestP, Failure) {
EXPECT_EQ(1, TypeParam()) << "Expected failure";
}
REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes);
#endif // GTEST_HAS_TYPED_TEST_P
#ifdef GTEST_HAS_DEATH_TEST
// We rely on the golden file to verify that tests whose test case
// name ends with DeathTest are run first.
TEST(ADeathTest, ShouldRunFirst) {
}
#ifdef GTEST_HAS_TYPED_TEST
// We rely on the golden file to verify that typed tests whose test
// case name ends with DeathTest are run first.
template <typename T>
class ATypedDeathTest : public testing::Test {
};
typedef testing::Types<int, double> NumericTypes;
TYPED_TEST_CASE(ATypedDeathTest, NumericTypes);
TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
}
#endif // GTEST_HAS_TYPED_TEST
#ifdef GTEST_HAS_TYPED_TEST_P
// We rely on the golden file to verify that type-parameterized tests
// whose test case name ends with DeathTest are run first.
template <typename T>
class ATypeParamDeathTest : public testing::Test {
};
TYPED_TEST_CASE_P(ATypeParamDeathTest);
TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
}
REGISTER_TYPED_TEST_CASE_P(ATypeParamDeathTest, ShouldRunFirst);
INSTANTIATE_TYPED_TEST_CASE_P(My, ATypeParamDeathTest, NumericTypes);
#endif // GTEST_HAS_TYPED_TEST_P
#endif // GTEST_HAS_DEATH_TEST
// Two test environments for testing testing::AddGlobalTestEnvironment().
class FooEnvironment : public testing::Environment {
+123 -5
View File
@@ -7,10 +7,25 @@ Expected: true
gtest_output_test_.cc:#: Failure
Value of: 3
Expected: 2
[==========] Running 37 tests from 13 test cases.
[==========] Running 48 tests from 21 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
[----------] 1 test from ADeathTest
[ RUN ] ADeathTest.ShouldRunFirst
[ OK ] ADeathTest.ShouldRunFirst
[----------] 1 test from ATypedDeathTest/0, where TypeParam = int
[ RUN ] ATypedDeathTest/0.ShouldRunFirst
[ OK ] ATypedDeathTest/0.ShouldRunFirst
[----------] 1 test from ATypedDeathTest/1, where TypeParam = double
[ RUN ] ATypedDeathTest/1.ShouldRunFirst
[ OK ] ATypedDeathTest/1.ShouldRunFirst
[----------] 1 test from My/ATypeParamDeathTest/0, where TypeParam = int
[ RUN ] My/ATypeParamDeathTest/0.ShouldRunFirst
[ OK ] My/ATypeParamDeathTest/0.ShouldRunFirst
[----------] 1 test from My/ATypeParamDeathTest/1, where TypeParam = double
[ RUN ] My/ATypeParamDeathTest/1.ShouldRunFirst
[ OK ] My/ATypeParamDeathTest/1.ShouldRunFirst
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
@@ -341,6 +356,36 @@ gtest.cc:#: Failure
Expected: 1 fatal failure
Actual: 0 failures
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[----------] 2 tests from TypedTest/0, where TypeParam = int
[ RUN ] TypedTest/0.Success
[ OK ] TypedTest/0.Success
[ RUN ] TypedTest/0.Failure
gtest_output_test_.cc:#: Failure
Value of: TypeParam()
Actual: 0
Expected: 1
Expected failure
[ FAILED ] TypedTest/0.Failure
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Failure
gtest_output_test_.cc:#: Failure
Value of: TypeParam()
Actual: \0
Expected: 1
Expected failure
[ FAILED ] Unsigned/TypedTestP/0.Failure
[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Failure
gtest_output_test_.cc:#: Failure
Value of: TypeParam()
Actual: 0
Expected: 1
Expected failure
[ FAILED ] Unsigned/TypedTestP/1.Failure
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
@@ -350,9 +395,9 @@ FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
Expected fatal failure.
[==========] 37 tests from 13 test cases ran.
[ PASSED ] 11 tests.
[ FAILED ] 26 tests, listed below:
[==========] 48 tests from 21 test cases ran.
[ PASSED ] 19 tests.
[ FAILED ] 29 tests, listed below:
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
@@ -379,5 +424,78 @@ Expected fatal failure.
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
26 FAILED TESTS
29 FAILED TESTS
The non-test part of the code is expected to have 2 failures.
gtest_output_test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
gtest_output_test_.cc:#: Failure
Value of: 3
Expected: 2
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
[==========] Running 4 tests from 2 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure
Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure
Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
gtest_output_test_.cc:#: Failure
Value of: false
Actual: false
Expected: true
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
[----------] 3 tests from FatalFailureTest (? ms total)
[----------] 1 test from LoggingTest
[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
i == 2
i == 3
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions (? ms)
[----------] 1 test from LoggingTest (? ms total)
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
Expected non-fatal failure.
FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
Expected fatal failure.
[==========] 4 tests from 2 test cases ran. (? ms total)
[ PASSED ] 0 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
4 FAILED TESTS
+161 -125
View File
@@ -1,35 +1,30 @@
The non-test part of the code is expected to have 2 failures.
gtest_output_test_.cc:#: Failure
Value of: false
gtest_output_test_.cc:#: error: Value of: false
Actual: false
Expected: true
gtest_output_test_.cc:#: Failure
Value of: 3
gtest_output_test_.cc:#: error: Value of: 3
Expected: 2
[==========] Running 40 tests from 16 test cases.
[==========] Running 46 tests from 19 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure
Value of: x
gtest_output_test_.cc:#: error: Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: Failure
Value of: x
gtest_output_test_.cc:#: error: Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
gtest_output_test_.cc:#: Failure
Value of: false
gtest_output_test_.cc:#: error: Value of: false
Actual: false
Expected: true
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
@@ -38,92 +33,78 @@ Expected: true
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 9
gtest_output_test_.cc:#: error: Expected: (3) >= (a[i]), actual: 3 vs 9
i == 2
i == 3
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
gtest_output_test_.cc:#: error: Expected: (3) >= (a[i]), actual: 3 vs 6
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
[----------] 5 tests from SCOPED_TRACETest
[ RUN ] SCOPED_TRACETest.ObeysScopes
(expected to fail)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and shouldn't have a trace.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and should have a trace.
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: Expected trace
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and shouldn't have a trace.
[ FAILED ] SCOPED_TRACETest.ObeysScopes
[ RUN ] SCOPED_TRACETest.WorksInLoop
(expected to fail)
gtest_output_test_.cc:#: Failure
Value of: n
gtest_output_test_.cc:#: error: Value of: n
Actual: 1
Expected: 2
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: i = 1
gtest_output_test_.cc:#: Failure
Value of: n
gtest_output_test_.cc:#: error: Value of: n
Actual: 2
Expected: 1
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: i = 2
[ FAILED ] SCOPED_TRACETest.WorksInLoop
[ RUN ] SCOPED_TRACETest.WorksInSubroutine
(expected to fail)
gtest_output_test_.cc:#: Failure
Value of: n
gtest_output_test_.cc:#: error: Value of: n
Actual: 1
Expected: 2
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: n = 1
gtest_output_test_.cc:#: Failure
Value of: n
gtest_output_test_.cc:#: error: Value of: n
Actual: 2
Expected: 1
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: n = 2
[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
[ RUN ] SCOPED_TRACETest.CanBeNested
(expected to fail)
gtest_output_test_.cc:#: Failure
Value of: n
gtest_output_test_.cc:#: error: Value of: n
Actual: 2
Expected: 1
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: n = 2
gtest_output_test_.cc:#:
[ FAILED ] SCOPED_TRACETest.CanBeNested
[ RUN ] SCOPED_TRACETest.CanBeRepeated
(expected to fail)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and should contain trace point A.
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and should contain trace point A and B.
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and should contain trace point A, B, and C.
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: C
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
This failure is expected, and should contain trace point A, B, and D.
gUnit trace:
Google Test trace:
gtest_output_test_.cc:#: D
gtest_output_test_.cc:#: B
gtest_output_test_.cc:#: A
@@ -131,88 +112,67 @@ gtest_output_test_.cc:#: A
[----------] 1 test from NonFatalFailureInFixtureConstructorTest
[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 5 failures)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #1, in the test fixture c'tor.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in SetUp().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #3, in the test body.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #4, in TearDown.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #5, in the test fixture d'tor.
[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
[----------] 1 test from FatalFailureInFixtureConstructorTest
[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
(expecting 2 failures)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #1, in the test fixture c'tor.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in the test fixture d'tor.
[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
[----------] 1 test from NonFatalFailureInSetUpTest
[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
(expecting 4 failures)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #1, in SetUp().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in the test function.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #3, in TearDown().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #4, in the test fixture d'tor.
[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
[----------] 1 test from FatalFailureInSetUpTest
[ RUN ] FatalFailureInSetUpTest.FailureInSetUp
(expecting 3 failures)
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #1, in SetUp().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in TearDown().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #3, in the test fixture d'tor.
[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
[----------] 1 test from ExceptionInFixtureCtorTest
[ RUN ] ExceptionInFixtureCtorTest.ExceptionInFixtureCtor
(expecting a failure on thrown exception in the test fixture's constructor)
unknown file: Failure
Exception thrown with code 0xc0000005 in the test fixture's constructor.
unknown file: error: Exception thrown with code 0xc0000005 in the test fixture's constructor.
[----------] 1 test from ExceptionInSetUpTest
[ RUN ] ExceptionInSetUpTest.ExceptionInSetUp
(expecting 3 failures)
unknown file: Failure
Exception thrown with code 0xc0000005 in SetUp().
gtest_output_test_.cc:#: Failure
Failed
unknown file: error: Exception thrown with code 0xc0000005 in SetUp().
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in TearDown().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #3, in the test fixture d'tor.
[ FAILED ] ExceptionInSetUpTest.ExceptionInSetUp
[----------] 1 test from ExceptionInTestFunctionTest
[ RUN ] ExceptionInTestFunctionTest.SEH
(expecting 3 failures)
unknown file: Failure
Exception thrown with code 0xc0000005 in the test body.
gtest_output_test_.cc:#: Failure
Failed
unknown file: error: Exception thrown with code 0xc0000005 in the test body.
gtest_output_test_.cc:#: error: Failed
Expected failure #2, in TearDown().
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected failure #3, in the test fixture d'tor.
[ FAILED ] ExceptionInTestFunctionTest.SEH
[----------] 4 tests from MixedUpTestCaseTest
@@ -221,8 +181,7 @@ Expected failure #3, in the test fixture d'tor.
[ RUN ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo
[ OK ] MixedUpTestCaseTest.SecondTestFromNamespaceFoo
[ RUN ] MixedUpTestCaseTest.ThisShouldFail
gtest.cc:#: Failure
Failed
gtest.cc:#: error: Failed
All tests in the same test case must use the same test fixture
class. However, in test case MixedUpTestCaseTest,
you defined test FirstTestFromNamespaceFoo and test ThisShouldFail
@@ -232,8 +191,7 @@ units and have the same name. You should probably rename one
of the classes to put the tests into different test cases.
[ FAILED ] MixedUpTestCaseTest.ThisShouldFail
[ RUN ] MixedUpTestCaseTest.ThisShouldFailToo
gtest.cc:#: Failure
Failed
gtest.cc:#: error: Failed
All tests in the same test case must use the same test fixture
class. However, in test case MixedUpTestCaseTest,
you defined test FirstTestFromNamespaceFoo and test ThisShouldFailToo
@@ -246,8 +204,7 @@ of the classes to put the tests into different test cases.
[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[ OK ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
[ RUN ] MixedUpTestCaseWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
gtest.cc:#: Failure
Failed
gtest.cc:#: error: Failed
All tests in the same test case must use the same test fixture
class. However, in test case MixedUpTestCaseWithSameTestNameTest,
you defined test TheSecondTestWithThisNameShouldFail and test TheSecondTestWithThisNameShouldFail
@@ -260,8 +217,7 @@ of the classes to put the tests into different test cases.
[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
[ OK ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
gtest.cc:#: Failure
Failed
gtest.cc:#: error: Failed
All tests in the same test case must use the same test fixture
class, so mixing TEST_F and TEST in the same test case is
illegal. In test case TEST_F_before_TEST_in_same_test_case,
@@ -274,8 +230,7 @@ case.
[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
[ OK ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
gtest.cc:#: Failure
Failed
gtest.cc:#: error: Failed
All tests in the same test case must use the same test fixture
class, so mixing TEST_F and TEST in the same test case is
illegal. In test case TEST_before_TEST_F_in_same_test_case,
@@ -293,14 +248,12 @@ case.
[ OK ] ExpectNonfatalFailureTest.SucceedsWhenThereIsOneNonfatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
gtest.cc:#: error: Expected: 1 non-fatal failure
Actual: 0 failures
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
gtest.cc:#: error: Expected: 1 non-fatal failure
Actual: 2 failures
gtest_output_test_.cc:#: Non-fatal failure:
Failed
@@ -313,8 +266,7 @@ Expected non-fatal failure 2.
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
gtest.cc:#: error: Expected: 1 non-fatal failure
Actual:
gtest_output_test_.cc:#: Fatal failure:
Failed
@@ -323,8 +275,7 @@ Expected fatal failure.
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 non-fatal failure
gtest.cc:#: error: Expected: 1 non-fatal failure
Actual: 0 failures
[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
[----------] 7 tests from ExpectFatalFailureTest
@@ -336,14 +287,12 @@ Expected: 1 non-fatal failure
[ OK ] ExpectFatalFailureTest.SucceedsWhenThereIsOneFatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
gtest.cc:#: error: Expected: 1 fatal failure
Actual: 0 failures
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
gtest.cc:#: error: Expected: 1 fatal failure
Actual: 2 failures
gtest_output_test_.cc:#: Fatal failure:
Failed
@@ -356,8 +305,7 @@ Expected fatal failure.
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
gtest.cc:#: error: Expected: 1 fatal failure
Actual:
gtest_output_test_.cc:#: Non-fatal failure:
Failed
@@ -366,22 +314,46 @@ Expected non-fatal failure.
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
[ RUN ] ExpectFatalFailureTest.FailsWhenStatementReturns
(expecting a failure)
gtest.cc:#: Failure
Expected: 1 fatal failure
gtest.cc:#: error: Expected: 1 fatal failure
Actual: 0 failures
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[----------] 2 tests from TypedTest/0, where TypeParam = int
[ RUN ] TypedTest/0.Success
[ OK ] TypedTest/0.Success
[ RUN ] TypedTest/0.Failure
gtest_output_test_.cc:#: error: Value of: TypeParam()
Actual: 0
Expected: 1
Expected failure
[ FAILED ] TypedTest/0.Failure
[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
[ RUN ] Unsigned/TypedTestP/0.Success
[ OK ] Unsigned/TypedTestP/0.Success
[ RUN ] Unsigned/TypedTestP/0.Failure
gtest_output_test_.cc:#: error: Value of: TypeParam()
Actual: \0
Expected: 1
Expected failure
[ FAILED ] Unsigned/TypedTestP/0.Failure
[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
[ RUN ] Unsigned/TypedTestP/1.Success
[ OK ] Unsigned/TypedTestP/1.Success
[ RUN ] Unsigned/TypedTestP/1.Failure
gtest_output_test_.cc:#: error: Value of: TypeParam()
Actual: 0
Expected: 1
Expected failure
[ FAILED ] Unsigned/TypedTestP/1.Failure
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected non-fatal failure.
FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
Failed
gtest_output_test_.cc:#: error: Failed
Expected fatal failure.
[==========] 40 tests from 16 test cases ran.
[ PASSED ] 11 tests.
[ FAILED ] 29 tests, listed below:
[==========] 46 tests from 19 test cases ran.
[ PASSED ] 14 tests.
[ FAILED ] 32 tests, listed below:
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
@@ -411,5 +383,69 @@ Expected fatal failure.
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
[ FAILED ] TypedTest/0.Failure, where TypeParam = int
[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
29 FAILED TESTS
32 FAILED TESTS
The non-test part of the code is expected to have 2 failures.
gtest_output_test_.cc:#: error: Value of: false
Actual: false
Expected: true
gtest_output_test_.cc:#: error: Value of: 3
Expected: 2
Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
[==========] Running 4 tests from 2 test cases.
[----------] Global test environment set-up.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
[----------] 3 tests from FatalFailureTest
[ RUN ] FatalFailureTest.FatalFailureInSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: error: Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
(expecting a failure that x should be 1)
gtest_output_test_.cc:#: error: Value of: x
Actual: 2
Expected: 1
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
(expecting a failure on false)
gtest_output_test_.cc:#: error: Value of: false
Actual: false
Expected: true
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
[----------] 3 tests from FatalFailureTest (? ms total)
[----------] 1 test from LoggingTest
[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
(expecting 2 failures on (3) >= (a[i]))
i == 0
i == 1
gtest_output_test_.cc:#: error: Expected: (3) >= (a[i]), actual: 3 vs 9
i == 2
i == 3
gtest_output_test_.cc:#: error: Expected: (3) >= (a[i]), actual: 3 vs 6
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions (? ms)
[----------] 1 test from LoggingTest (? ms total)
[----------] Global test environment tear-down
BarEnvironment::TearDown() called.
gtest_output_test_.cc:#: error: Failed
Expected non-fatal failure.
FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: error: Failed
Expected fatal failure.
[==========] 4 tests from 2 test cases ran. (? ms total)
[ PASSED ] 0 tests.
[ FAILED ] 4 tests, listed below:
[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
4 FAILED TESTS
+4 -2
View File
@@ -58,6 +58,8 @@ using testing::GTEST_FLAG(repeat);
namespace {
// We need this when we are testing Google Test itself and therefore
// cannot use Google Test assertions.
#define GTEST_CHECK_INT_EQ_(expected, actual) \
do {\
const int expected_val = (expected);\
@@ -110,11 +112,13 @@ int g_death_test_count = 0;
TEST(BarDeathTest, ThreadSafeAndFast) {
g_death_test_count++;
#ifdef GTEST_HAS_DEATH_TEST
GTEST_FLAG(death_test_style) = "threadsafe";
EXPECT_DEATH(abort(), "");
GTEST_FLAG(death_test_style) = "fast";
EXPECT_DEATH(abort(), "");
#endif // GTEST_HAS_DEATH_TEST
}
// Resets the count for each test.
@@ -128,8 +132,6 @@ void ResetCounts() {
// Checks that the count for each test is expected.
void CheckCounts(int expected) {
// We cannot use Google Test assertions here since we are testing Google Test
// itself.
GTEST_CHECK_INT_EQ_(expected, g_environment_set_up_count);
GTEST_CHECK_INT_EQ_(expected, g_environment_tear_down_count);
GTEST_CHECK_INT_EQ_(expected, g_should_fail_count);
+20
View File
@@ -96,6 +96,26 @@ def GetBuildDir():
return os.path.abspath(GetFlag('gtest_build_dir'))
def GetExitStatus(exit_code):
"""Returns the argument to exit(), or -1 if exit() wasn't called.
Args:
exit_code: the result value of os.system(command).
"""
if os.name == 'nt':
# On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
# the argument to exit() directly.
return exit_code
else:
# On Unix, os.WEXITSTATUS() must be used to extract the exit status
# from the result of os.system().
if os.WIFEXITED(exit_code):
return os.WEXITSTATUS(exit_code)
else:
return -1
def Main():
"""Runs the unit test."""
+3 -2
View File
@@ -80,8 +80,9 @@ def GetOutput(command):
def TestExitCodeAndOutput(command):
"""Runs the given command and verifies its exit code and output."""
# 256 corresponds to return code 0.
AssertEq(256, os.system(command))
# Verifies that 'command' exits with code 1.
AssertEq(1, gtest_test_utils.GetExitStatus(os.system(command)))
output = GetOutput(command)
Assert('InitGoogleTest' in output)
+687 -251
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -103,7 +103,7 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
command = "cd %s && %s --gtest_output=xml:%s &> /dev/null" % (
tempfile.mkdtemp(), gtest_prog_path, self.output_dir_)
status = os.system(command)
self.assertEquals(0, status)
self.assertEquals(0, gtest_test_utils.GetExitStatus(status))
# TODO(wan@google.com): libtool causes the built test binary to be
# named lt-gtest_xml_outfiles_test_ instead of
+11 -9
View File
@@ -128,7 +128,7 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
status = os.system("cd %s && %s %s=xml &> /dev/null"
% (temp_dir, gtest_prog_path,
GTEST_OUTPUT_FLAG))
self.assertEquals(0, status)
self.assertEquals(0, gtest_test_utils.GetExitStatus(status))
self.assert_(os.path.isfile(output_file))
@@ -147,14 +147,16 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
command = ("%s %s=xml:%s &> /dev/null"
% (gtest_prog_path, GTEST_OUTPUT_FLAG, xml_path))
status = os.system(command)
signal = status & 0xff
self.assertEquals(0, signal,
"%s was killed by signal %d" % (gtest_prog_name, signal))
exit_code = status >> 8
self.assertEquals(expected_exit_code, exit_code,
"'%s' exited with code %s, which doesn't match "
"the expected exit code %s."
% (command, exit_code, expected_exit_code))
if os.WIFSIGNALED(status):
signal = os.WTERMSIG(status)
self.assert_(False,
"%s was killed by signal %d" % (gtest_prog_name, signal))
else:
exit_code = gtest_test_utils.GetExitStatus(status)
self.assertEquals(expected_exit_code, exit_code,
"'%s' exited with code %s, which doesn't match "
"the expected exit code %s."
% (command, exit_code, expected_exit_code))
expected = minidom.parseString(expected_xml)
actual = minidom.parse(xml_path)
+30
View File
@@ -0,0 +1,30 @@
//
// DebugProject.xcconfig
//
// These are Debug Configuration project settings for the gtest framework and
// examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog.
// This file is based on the Xcode Configuration files in:
// http://code.google.com/p/google-toolbox-for-mac/
//
#include "General.xcconfig"
// No optimization
GCC_OPTIMIZATION_LEVEL = 0
// Deployment postprocessing is what triggers Xcode to strip, turn it off
DEPLOYMENT_POSTPROCESSING = NO
// Dead code stripping off
DEAD_CODE_STRIPPING = NO
// Debug symbols should be on obviously
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
// Define the DEBUG macro in all debug builds
OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1
// These are turned off to avoid STL incompatibilities with client code
// // Turns on special C++ STL checks to "encourage" good STL use
// GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS
+17
View File
@@ -0,0 +1,17 @@
//
// FrameworkTarget.xcconfig
//
// These are Framework target settings for the gtest framework and examples. It
// is set in the "Based On:" dropdown in the "Target" info dialog.
// This file is based on the Xcode Configuration files in:
// http://code.google.com/p/google-toolbox-for-mac/
//
// Dynamic libs need to be position independent
GCC_DYNAMIC_NO_PIC = NO
// Dynamic libs should not have their external symbols stripped.
STRIP_STYLE = non-global
// Installation Directory
INSTALL_PATH = @loader_path/../Frameworks
+41
View File
@@ -0,0 +1,41 @@
//
// General.xcconfig
//
// These are General configuration settings for the gtest framework and
// examples.
// This file is based on the Xcode Configuration files in:
// http://code.google.com/p/google-toolbox-for-mac/
//
// Build for PPC and Intel, 32- and 64-bit
ARCHS = i386 x86_64 ppc ppc64
// Zerolink prevents link warnings so turn it off
ZERO_LINK = NO
// Prebinding considered unhelpful in 10.3 and later
PREBINDING = NO
// Strictest warning policy
WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare
// Work around Xcode bugs by using external strip. See:
// http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html
SEPARATE_STRIP = YES
// Force C99 dialect
GCC_C_LANGUAGE_STANDARD = c99
// not sure why apple defaults this on, but it's pretty risky
ALWAYS_SEARCH_USER_PATHS = NO
// Turn on position dependent code for most cases (overridden where appropriate)
GCC_DYNAMIC_NO_PIC = YES
// Default SDK and minimum OS version is 10.4
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk
MACOSX_DEPLOYMENT_TARGET = 10.4
GCC_VERSION = 4.0
// VERSIONING BUILD SETTINGS (used in Info.plist)
GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc.
+32
View File
@@ -0,0 +1,32 @@
//
// ReleaseProject.xcconfig
//
// These are Release Configuration project settings for the gtest framework
// and examples. It is set in the "Based On:" dropdown in the "Project" info
// dialog.
// This file is based on the Xcode Configuration files in:
// http://code.google.com/p/google-toolbox-for-mac/
//
#include "General.xcconfig"
// subconfig/Release.xcconfig
// Optimize for space and size (Apple recommendation)
GCC_OPTIMIZATION_LEVEL = s
// Deploment postprocessing is what triggers Xcode to strip
DEPLOYMENT_POSTPROCESSING = YES
// No symbols
GCC_GENERATE_DEBUGGING_SYMBOLS = NO
// Dead code strip does not affect ObjC code but can help for C
DEAD_CODE_STRIPPING = YES
// NDEBUG is used by things like assert.h, so define it for general compat.
// ASSERT going away in release tends to create unused vars.
OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable
// When we strip we want to strip all symbols in release, but save externals.
STRIP_STYLE = all
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.google.${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>GTEST_VERSIONINFO_LONG</string>
<key>CFBundleShortVersionString</key>
<string>GTEST_VERSIONINFO_SHORT</string>
<key>CFBundleGetInfoString</key>
<string>${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT}</string>
<key>NSHumanReadableCopyright</key>
<string>${GTEST_VERSIONINFO_ABOUT}</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.google.gtest.${PRODUCT_NAME:identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,335 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
3B7EB1250E5AEE3500C7F239 /* widget.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1230E5AEE3500C7F239 /* widget.cc */; };
3B7EB1260E5AEE3500C7F239 /* widget.h in Headers */ = {isa = PBXBuildFile; fileRef = 3B7EB1240E5AEE3500C7F239 /* widget.h */; settings = {ATTRIBUTES = (Public, ); }; };
3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3B7EB1270E5AEE4600C7F239 /* widget_test.cc */; };
3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */; };
3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BA867DC0E561B7C00326077 /* gtest.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
3B07BDF00E3F3FAE00647869 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gTestExample;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WidgetFrameworkTest; sourceTree = BUILT_PRODUCTS_DIR; };
3B7EB1230E5AEE3500C7F239 /* widget.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget.cc; sourceTree = "<group>"; };
3B7EB1240E5AEE3500C7F239 /* widget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = widget.h; sourceTree = "<group>"; };
3B7EB1270E5AEE4600C7F239 /* widget_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = widget_test.cc; sourceTree = "<group>"; };
3BA867DC0E561B7C00326077 /* gtest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = gtest.framework; path = ../../build/Debug/gtest.framework; sourceTree = "<group>"; };
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D07F2C80486CC7A007CD1D0 /* Widget.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Widget.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
3B07BDE80E3F3F9E00647869 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3B7EB1480E5AF3B400C7F239 /* Widget.framework in Frameworks */,
3B7F0C8D0E567CC5009CA236 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
034768DDFF38A45A11DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8D07F2C80486CC7A007CD1D0 /* Widget.framework */,
3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* gTestExample */ = {
isa = PBXGroup;
children = (
08FB77ACFE841707C02AAC07 /* Source */,
089C1665FE841158C02AAC07 /* Resources */,
3B07BE350E4094E400647869 /* Test */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DDFF38A45A11DB9C8B /* Products */,
);
name = gTestExample;
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
3BA867DC0E561B7C00326077 /* gtest.framework */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77ACFE841707C02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
3B7EB1230E5AEE3500C7F239 /* widget.cc */,
3B7EB1240E5AEE3500C7F239 /* widget.h */,
);
name = Source;
sourceTree = "<group>";
};
3B07BE350E4094E400647869 /* Test */ = {
isa = PBXGroup;
children = (
3B7EB1270E5AEE4600C7F239 /* widget_test.cc */,
);
name = Test;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
3B7EB1260E5AEE3500C7F239 /* widget.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
3B07BDE90E3F3F9E00647869 /* WidgetFrameworkTest */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3B07BDF40E3F3FB600647869 /* Build configuration list for PBXNativeTarget "WidgetFrameworkTest" */;
buildPhases = (
3B07BDE70E3F3F9E00647869 /* Sources */,
3B07BDE80E3F3F9E00647869 /* Frameworks */,
);
buildRules = (
);
dependencies = (
3B07BDF10E3F3FAE00647869 /* PBXTargetDependency */,
);
name = WidgetFrameworkTest;
productName = gTestExampleTest;
productReference = 3B07BDEA0E3F3F9E00647869 /* WidgetFrameworkTest */;
productType = "com.apple.product-type.tool";
};
8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "WidgetFramework" */;
buildPhases = (
8D07F2C10486CC7A007CD1D0 /* Sources */,
8D07F2C30486CC7A007CD1D0 /* Frameworks */,
8D07F2BD0486CC7A007CD1D0 /* Headers */,
8D07F2BF0486CC7A007CD1D0 /* Resources */,
8D07F2C50486CC7A007CD1D0 /* Rez */,
);
buildRules = (
);
dependencies = (
);
name = WidgetFramework;
productInstallPath = "$(HOME)/Library/Frameworks";
productName = gTestExample;
productReference = 8D07F2C80486CC7A007CD1D0 /* Widget.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "WidgetFramework" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* gTestExample */;
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */,
3B07BDE90E3F3F9E00647869 /* WidgetFrameworkTest */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXRezBuildPhase section */
8D07F2C50486CC7A007CD1D0 /* Rez */ = {
isa = PBXRezBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXRezBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
3B07BDE70E3F3F9E00647869 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3B7EB1280E5AEE4600C7F239 /* widget_test.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8D07F2C10486CC7A007CD1D0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3B7EB1250E5AEE3500C7F239 /* widget.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
3B07BDF10E3F3FAE00647869 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* WidgetFramework */;
targetProxy = 3B07BDF00E3F3FAE00647869 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
3B07BDEC0E3F3F9F00647869 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/externals/googletest/xcode/build/Debug\"",
"\"$(SRCROOT)/../../build/Debug\"",
);
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = WidgetFrameworkTest;
};
name = Debug;
};
3B07BDED0E3F3F9F00647869 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/externals/googletest/xcode/build/Debug\"",
"\"$(SRCROOT)/../../build/Debug\"",
);
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = WidgetFrameworkTest;
};
name = Release;
};
4FADC24308B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
PRODUCT_NAME = Widget;
WRAPPER_EXTENSION = framework;
};
name = Debug;
};
4FADC24408B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "@loader_path/../Frameworks";
LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
PRODUCT_NAME = Widget;
WRAPPER_EXTENSION = framework;
};
name = Release;
};
4FADC24708B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx10.5;
};
name = Debug;
};
4FADC24808B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
SDKROOT = macosx10.5;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3B07BDF40E3F3FB600647869 /* Build configuration list for PBXNativeTarget "WidgetFrameworkTest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3B07BDEC0E3F3F9F00647869 /* Debug */,
3B07BDED0E3F3F9F00647869 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "WidgetFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24308B4156D00ABE55E /* Debug */,
4FADC24408B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "WidgetFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24708B4156D00ABE55E /* Debug */,
4FADC24808B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}
+63
View File
@@ -0,0 +1,63 @@
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: preston.jackson@gmail.com (Preston Jackson)
//
// Google Test - FrameworkSample
// widget.cc
//
// Widget is a very simple class used for demonstrating the use of gtest
#include "widget.h"
Widget::Widget(int number, const std::string& name)
: number_(number),
name_(name) {}
Widget::~Widget() {}
float Widget::GetFloatValue() const {
return number_;
}
int Widget::GetIntValue() const {
return static_cast<int>(number_);
}
std::string Widget::GetStringValue() const {
return name_;
}
void Widget::GetCharPtrValue(char* buffer, size_t max_size) const {
// Copy the char* representation of name_ into buffer, up to max_size.
strncpy(buffer, name_.c_str(), max_size-1);
buffer[max_size-1] = '\0';
return;
}
+59
View File
@@ -0,0 +1,59 @@
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: preston.jackson@gmail.com (Preston Jackson)
//
// Google Test - FrameworkSample
// widget.h
//
// Widget is a very simple class used for demonstrating the use of gtest. It
// simply stores two values a string and an integer, which are returned via
// public accessors in multiple forms.
#import <string>
class Widget {
public:
Widget(int number, const std::string& name);
~Widget();
// Public accessors to number data
float GetFloatValue() const;
int GetIntValue() const;
// Public accessors to the string data
std::string GetStringValue() const;
void GetCharPtrValue(char* buffer, size_t max_size) const;
private:
// Data members
float number_;
std::string name_;
};
@@ -0,0 +1,68 @@
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: preston.jackson@gmail.com (Preston Jackson)
//
// Google Test - FrameworkSample
// widget_test.cc
//
// This is a simple test file for the Widget class in the Widget.framework
#include <string>
#include <gtest/gtest.h>
#include <Widget/widget.h>
// This test verifies that the constructor sets the internal state of the
// Widget class correctly.
TEST(WidgetInitializerTest, TestConstructor) {
Widget widget(1.0f, "name");
EXPECT_FLOAT_EQ(1.0f, widget.GetFloatValue());
EXPECT_EQ(std::string("name"), widget.GetStringValue());
}
// This test verifies the conversion of the float and string values to int and
// char*, respectively.
TEST(WidgetInitializerTest, TestConversion) {
Widget widget(1.0f, "name");
EXPECT_EQ(1, widget.GetIntValue());
size_t max_size = 128;
char buffer[max_size];
widget.GetCharPtrValue(buffer, max_size);
EXPECT_STREQ("name", buffer);
}
// Use the Google Test main that is linked into the framework. It does something
// like this:
// int main(int argc, char** argv) {
// testing::InitGoogleTest(&argc, argv);
// return RUN_ALL_TESTS();
// }
+71
View File
@@ -0,0 +1,71 @@
#/usr/bin/python
"""A script to prepare version informtion for use the gtest Info.plist file.
This script extracts the version information from the configure.ac file and
uses it to generate a header file containing the same information. The
#defines in this header file will be included in during the generation of
the Info.plist of the framework, giving the correct value to the version
shown in the Finder.
This script makes the following assumptions (these are faults of the script,
not problems with the Autoconf):
1. The AC_INIT macro will be contained within the first 1024 characters
of configure.ac
2. The version string will be 3 integers separated by periods and will be
surrounded by squre brackets, "[" and "]" (e.g. [1.0.1]). The first
segment represents the major version, the second represents the minor
version and the third represents the fix version.
3. No ")" character exists between the opening "(" and closing ")" of
AC_INIT, including in comments and character strings.
"""
import sys
import re
# Read the command line argument (the output directory for Version.h)
if (len(sys.argv) < 3):
print "Usage: /usr/bin/python versiongenerate.py input_dir output_dir"
sys.exit(1)
else:
input_dir = sys.argv[1]
output_dir = sys.argv[2]
# Read the first 1024 characters of the configure.ac file
config_file = open("%s/configure.ac" % input_dir, 'r')
buffer_size = 1024
opening_string = config_file.read(buffer_size)
config_file.close()
# Extract the version string from the AC_INIT macro
# The following init_expression means:
# Extract three integers separated by periods and surrounded by squre
# brackets(e.g. "[1.0.1]") between "AC_INIT(" and ")". Do not be greedy
# (*? is the non-greedy flag) since that would pull in everything between
# the first "(" and the last ")" in the file.
version_expression = re.compile(r"AC_INIT\(.*?\[(\d+)\.(\d+)\.(\d+)\].*?\)",
re.DOTALL)
version_values = version_expression.search(opening_string)
major_version = version_values.group(1)
minor_version = version_values.group(2)
fix_version = version_values.group(3)
# Write the version information to a header file to be included in the
# Info.plist file.
file_data = """//
// DO NOT MODIFY THIS FILE (but you can delete it)
//
// This file is autogenerated by the versiongenerate.py script. This script
// is executed in a "Run Script" build phase when creating gtest.framework. This
// header file is not used during compilation of C-source. Rather, it simply
// defines some version strings for substitution in the Info.plist. Because of
// this, we are not not restricted to C-syntax nor are we using include guards.
//
#define GTEST_VERSIONINFO_SHORT %s.%s
#define GTEST_VERSIONINFO_LONG %s.%s.%s
""" % (major_version, minor_version, major_version, minor_version, fix_version)
version_file = open("%s/Version.h" % output_dir, 'w')
version_file.write(file_data)
version_file.close()
+965
View File
@@ -0,0 +1,965 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXAggregateTarget section */
40C44ADC0E3798F4008FCC51 /* Version Info */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 40C44AE40E379905008FCC51 /* Build configuration list for PBXAggregateTarget "Version Info" */;
buildPhases = (
40C44ADB0E3798F4008FCC51 /* Generate Version.h */,
);
comments = "The generation of Version.h must be performed in its own target. Since the Info.plist is preprocessed before any of the other build phases in gtest, the Version.h file would not be ready if included as a build phase of that target.";
dependencies = (
);
name = "Version Info";
productName = Version.h;
};
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
22A865FD0E70A35700F7AE6E /* gtest-typed-test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 22A865FC0E70A35700F7AE6E /* gtest-typed-test.cc */; };
22A866080E70A39900F7AE6E /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
22A866190E70A41000F7AE6E /* sample6_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 22A866180E70A41000F7AE6E /* sample6_unittest.cc */; };
3BF6F2A00E79B5AD000F2EEE /* gtest-type-util.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */; };
3BF6F2A50E79B616000F2EEE /* gtest-typed-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
404884380E2F799B00CF7658 /* gtest-death-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DB0E2F799B00CF7658 /* gtest-death-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
404884390E2F799B00CF7658 /* gtest-message.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DC0E2F799B00CF7658 /* gtest-message.h */; settings = {ATTRIBUTES = (Public, ); }; };
4048843A0E2F799B00CF7658 /* gtest-spi.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DD0E2F799B00CF7658 /* gtest-spi.h */; settings = {ATTRIBUTES = (Public, ); }; };
4048843B0E2F799B00CF7658 /* gtest.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DE0E2F799B00CF7658 /* gtest.h */; settings = {ATTRIBUTES = (Public, ); }; };
4048843C0E2F799B00CF7658 /* gtest_pred_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */; settings = {ATTRIBUTES = (Public, ); }; };
4048843D0E2F799B00CF7658 /* gtest_prod.h in Headers */ = {isa = PBXBuildFile; fileRef = 404883E00E2F799B00CF7658 /* gtest_prod.h */; settings = {ATTRIBUTES = (Public, ); }; };
404884500E2F799B00CF7658 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 404883F60E2F799B00CF7658 /* README */; };
4048845F0E2F799B00CF7658 /* gtest-death-test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404884080E2F799B00CF7658 /* gtest-death-test.cc */; };
404884600E2F799B00CF7658 /* gtest-filepath.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404884090E2F799B00CF7658 /* gtest-filepath.cc */; };
404884620E2F799B00CF7658 /* gtest-port.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4048840B0E2F799B00CF7658 /* gtest-port.cc */; };
404884630E2F799B00CF7658 /* gtest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4048840C0E2F799B00CF7658 /* gtest.cc */; };
404884640E2F799B00CF7658 /* gtest_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4048840D0E2F799B00CF7658 /* gtest_main.cc */; };
404884A00E2F7BE600CF7658 /* gtest-death-test-internal.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */; };
404884A10E2F7BE600CF7658 /* gtest-filepath.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E30E2F799B00CF7658 /* gtest-filepath.h */; };
404884A20E2F7BE600CF7658 /* gtest-internal.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E40E2F799B00CF7658 /* gtest-internal.h */; };
404884A30E2F7BE600CF7658 /* gtest-port.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E50E2F799B00CF7658 /* gtest-port.h */; };
404884A40E2F7BE600CF7658 /* gtest-string.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 404883E60E2F799B00CF7658 /* gtest-string.h */; };
404884AC0E2F7CD900CF7658 /* CHANGES in Resources */ = {isa = PBXBuildFile; fileRef = 404884A90E2F7CD900CF7658 /* CHANGES */; };
404884AD0E2F7CD900CF7658 /* CONTRIBUTORS in Resources */ = {isa = PBXBuildFile; fileRef = 404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */; };
404884AE0E2F7CD900CF7658 /* COPYING in Resources */ = {isa = PBXBuildFile; fileRef = 404884AB0E2F7CD900CF7658 /* COPYING */; };
404885990E2F816100CF7658 /* sample1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883F80E2F799B00CF7658 /* sample1.cc */; };
4048859B0E2F816100CF7658 /* sample1_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883FA0E2F799B00CF7658 /* sample1_unittest.cc */; };
404885A90E2F825800CF7658 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
404885B70E2F82BA00CF7658 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
404885CF0E2F82F000CF7658 /* sample2.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883FB0E2F799B00CF7658 /* sample2.cc */; };
404885D00E2F82F000CF7658 /* sample2_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883FD0E2F799B00CF7658 /* sample2_unittest.cc */; };
404885DB0E2F832A00CF7658 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
404885E80E2F833000CF7658 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
404885F50E2F833400CF7658 /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */; };
404886050E2F83DF00CF7658 /* sample3_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883FF0E2F799B00CF7658 /* sample3_unittest.cc */; };
404886080E2F840300CF7658 /* sample4.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404884000E2F799B00CF7658 /* sample4.cc */; };
404886090E2F840300CF7658 /* sample4_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404884020E2F799B00CF7658 /* sample4_unittest.cc */; };
4048860C0E2F840E00CF7658 /* sample5_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404884030E2F799B00CF7658 /* sample5_unittest.cc */; };
404886140E2F849100CF7658 /* sample1.cc in Sources */ = {isa = PBXBuildFile; fileRef = 404883F80E2F799B00CF7658 /* sample1.cc */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
22A866030E70A39900F7AE6E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
404885A70E2F824900CF7658 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
404885B20E2F82BA00CF7658 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
404885D60E2F832A00CF7658 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
404885E30E2F833000CF7658 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
404885F00E2F833400CF7658 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 8D07F2BC0486CC7A007CD1D0;
remoteInfo = gtest;
};
40C44AE50E379922008FCC51 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 40C44ADC0E3798F4008FCC51;
remoteInfo = Version.h;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
404884A50E2F7C0400CF7658 /* Copy Headers Internal */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = Headers/internal;
dstSubfolderSpec = 6;
files = (
404884A00E2F7BE600CF7658 /* gtest-death-test-internal.h in Copy Headers Internal */,
404884A10E2F7BE600CF7658 /* gtest-filepath.h in Copy Headers Internal */,
404884A20E2F7BE600CF7658 /* gtest-internal.h in Copy Headers Internal */,
404884A30E2F7BE600CF7658 /* gtest-port.h in Copy Headers Internal */,
404884A40E2F7BE600CF7658 /* gtest-string.h in Copy Headers Internal */,
3BF6F2A00E79B5AD000F2EEE /* gtest-type-util.h in Copy Headers Internal */,
);
name = "Copy Headers Internal";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
22A865FC0E70A35700F7AE6E /* gtest-typed-test.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-typed-test.cc"; sourceTree = "<group>"; };
22A8660C0E70A39900F7AE6E /* sample6 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample6; sourceTree = BUILT_PRODUCTS_DIR; };
22A866180E70A41000F7AE6E /* sample6_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = sample6_unittest.cc; sourceTree = "<group>"; };
3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-type-util.h"; sourceTree = "<group>"; };
3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-typed-test.h"; sourceTree = "<group>"; };
403EE37C0E377822004BD1E2 /* versiongenerate.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = versiongenerate.py; sourceTree = "<group>"; };
404883DB0E2F799B00CF7658 /* gtest-death-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test.h"; sourceTree = "<group>"; };
404883DC0E2F799B00CF7658 /* gtest-message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-message.h"; sourceTree = "<group>"; };
404883DD0E2F799B00CF7658 /* gtest-spi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-spi.h"; sourceTree = "<group>"; };
404883DE0E2F799B00CF7658 /* gtest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest.h; sourceTree = "<group>"; };
404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest_pred_impl.h; sourceTree = "<group>"; };
404883E00E2F799B00CF7658 /* gtest_prod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gtest_prod.h; sourceTree = "<group>"; };
404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-death-test-internal.h"; sourceTree = "<group>"; };
404883E30E2F799B00CF7658 /* gtest-filepath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-filepath.h"; sourceTree = "<group>"; };
404883E40E2F799B00CF7658 /* gtest-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-internal.h"; sourceTree = "<group>"; };
404883E50E2F799B00CF7658 /* gtest-port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-port.h"; sourceTree = "<group>"; };
404883E60E2F799B00CF7658 /* gtest-string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-string.h"; sourceTree = "<group>"; };
404883F60E2F799B00CF7658 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../README; sourceTree = SOURCE_ROOT; };
404883F80E2F799B00CF7658 /* sample1.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample1.cc; sourceTree = "<group>"; };
404883F90E2F799B00CF7658 /* sample1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample1.h; sourceTree = "<group>"; };
404883FA0E2F799B00CF7658 /* sample1_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample1_unittest.cc; sourceTree = "<group>"; };
404883FB0E2F799B00CF7658 /* sample2.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample2.cc; sourceTree = "<group>"; };
404883FC0E2F799B00CF7658 /* sample2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample2.h; sourceTree = "<group>"; };
404883FD0E2F799B00CF7658 /* sample2_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample2_unittest.cc; sourceTree = "<group>"; };
404883FE0E2F799B00CF7658 /* sample3-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "sample3-inl.h"; sourceTree = "<group>"; };
404883FF0E2F799B00CF7658 /* sample3_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample3_unittest.cc; sourceTree = "<group>"; };
404884000E2F799B00CF7658 /* sample4.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample4.cc; sourceTree = "<group>"; };
404884010E2F799B00CF7658 /* sample4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sample4.h; sourceTree = "<group>"; };
404884020E2F799B00CF7658 /* sample4_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample4_unittest.cc; sourceTree = "<group>"; };
404884030E2F799B00CF7658 /* sample5_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sample5_unittest.cc; sourceTree = "<group>"; };
404884080E2F799B00CF7658 /* gtest-death-test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-death-test.cc"; sourceTree = "<group>"; };
404884090E2F799B00CF7658 /* gtest-filepath.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-filepath.cc"; sourceTree = "<group>"; };
4048840A0E2F799B00CF7658 /* gtest-internal-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-internal-inl.h"; sourceTree = "<group>"; };
4048840B0E2F799B00CF7658 /* gtest-port.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-port.cc"; sourceTree = "<group>"; };
4048840C0E2F799B00CF7658 /* gtest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gtest.cc; sourceTree = "<group>"; };
4048840D0E2F799B00CF7658 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gtest_main.cc; sourceTree = "<group>"; };
404884A90E2F7CD900CF7658 /* CHANGES */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CHANGES; path = ../CHANGES; sourceTree = SOURCE_ROOT; };
404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CONTRIBUTORS; path = ../CONTRIBUTORS; sourceTree = SOURCE_ROOT; };
404884AB0E2F7CD900CF7658 /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = COPYING; path = ../COPYING; sourceTree = SOURCE_ROOT; };
404885930E2F814C00CF7658 /* sample1 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample1; sourceTree = BUILT_PRODUCTS_DIR; };
404885BB0E2F82BA00CF7658 /* sample2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample2; sourceTree = BUILT_PRODUCTS_DIR; };
404885DF0E2F832A00CF7658 /* sample3 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample3; sourceTree = BUILT_PRODUCTS_DIR; };
404885EC0E2F833000CF7658 /* sample4 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample4; sourceTree = BUILT_PRODUCTS_DIR; };
404885F90E2F833400CF7658 /* sample5 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = sample5; sourceTree = BUILT_PRODUCTS_DIR; };
40D4CDF10E30E07400294801 /* DebugProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugProject.xcconfig; sourceTree = "<group>"; };
40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FrameworkTarget.xcconfig; sourceTree = "<group>"; };
40D4CDF30E30E07400294801 /* General.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = General.xcconfig; sourceTree = "<group>"; };
40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReleaseProject.xcconfig; sourceTree = "<group>"; };
40D4CF510E30F5E200294801 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D07F2C80486CC7A007CD1D0 /* gtest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gtest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
22A866070E70A39900F7AE6E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
22A866080E70A39900F7AE6E /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885910E2F814C00CF7658 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
404885A90E2F825800CF7658 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885B60E2F82BA00CF7658 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
404885B70E2F82BA00CF7658 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885DA0E2F832A00CF7658 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
404885DB0E2F832A00CF7658 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885E70E2F833000CF7658 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
404885E80E2F833000CF7658 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885F40E2F833400CF7658 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
404885F50E2F833400CF7658 /* gtest.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8D07F2C30486CC7A007CD1D0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
034768DDFF38A45A11DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8D07F2C80486CC7A007CD1D0 /* gtest.framework */,
404885930E2F814C00CF7658 /* sample1 */,
404885BB0E2F82BA00CF7658 /* sample2 */,
404885DF0E2F832A00CF7658 /* sample3 */,
404885EC0E2F833000CF7658 /* sample4 */,
404885F90E2F833400CF7658 /* sample5 */,
22A8660C0E70A39900F7AE6E /* sample6 */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* gtest */ = {
isa = PBXGroup;
children = (
40D4CDF00E30E07400294801 /* Config */,
08FB77ACFE841707C02AAC07 /* Source */,
40D4CF4E0E30F5E200294801 /* Resources */,
403EE37B0E377822004BD1E2 /* Scripts */,
034768DDFF38A45A11DB9C8B /* Products */,
);
name = gtest;
sourceTree = "<group>";
};
08FB77ACFE841707C02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
404884A90E2F7CD900CF7658 /* CHANGES */,
404884AA0E2F7CD900CF7658 /* CONTRIBUTORS */,
404884AB0E2F7CD900CF7658 /* COPYING */,
404883F60E2F799B00CF7658 /* README */,
404883D90E2F799B00CF7658 /* include */,
404883F70E2F799B00CF7658 /* samples */,
404884070E2F799B00CF7658 /* src */,
);
name = Source;
sourceTree = "<group>";
};
403EE37B0E377822004BD1E2 /* Scripts */ = {
isa = PBXGroup;
children = (
403EE37C0E377822004BD1E2 /* versiongenerate.py */,
);
path = Scripts;
sourceTree = "<group>";
};
404883D90E2F799B00CF7658 /* include */ = {
isa = PBXGroup;
children = (
404883DA0E2F799B00CF7658 /* gtest */,
);
name = include;
path = ../include;
sourceTree = SOURCE_ROOT;
};
404883DA0E2F799B00CF7658 /* gtest */ = {
isa = PBXGroup;
children = (
404883DB0E2F799B00CF7658 /* gtest-death-test.h */,
404883DC0E2F799B00CF7658 /* gtest-message.h */,
404883DD0E2F799B00CF7658 /* gtest-spi.h */,
404883DE0E2F799B00CF7658 /* gtest.h */,
404883DF0E2F799B00CF7658 /* gtest_pred_impl.h */,
404883E00E2F799B00CF7658 /* gtest_prod.h */,
404883E10E2F799B00CF7658 /* internal */,
3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */,
);
path = gtest;
sourceTree = "<group>";
};
404883E10E2F799B00CF7658 /* internal */ = {
isa = PBXGroup;
children = (
404883E20E2F799B00CF7658 /* gtest-death-test-internal.h */,
404883E30E2F799B00CF7658 /* gtest-filepath.h */,
404883E40E2F799B00CF7658 /* gtest-internal.h */,
404883E50E2F799B00CF7658 /* gtest-port.h */,
404883E60E2F799B00CF7658 /* gtest-string.h */,
3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */,
);
path = internal;
sourceTree = "<group>";
};
404883F70E2F799B00CF7658 /* samples */ = {
isa = PBXGroup;
children = (
404883F80E2F799B00CF7658 /* sample1.cc */,
404883F90E2F799B00CF7658 /* sample1.h */,
404883FA0E2F799B00CF7658 /* sample1_unittest.cc */,
404883FB0E2F799B00CF7658 /* sample2.cc */,
404883FC0E2F799B00CF7658 /* sample2.h */,
404883FD0E2F799B00CF7658 /* sample2_unittest.cc */,
404883FE0E2F799B00CF7658 /* sample3-inl.h */,
404883FF0E2F799B00CF7658 /* sample3_unittest.cc */,
404884000E2F799B00CF7658 /* sample4.cc */,
404884010E2F799B00CF7658 /* sample4.h */,
404884020E2F799B00CF7658 /* sample4_unittest.cc */,
404884030E2F799B00CF7658 /* sample5_unittest.cc */,
22A866180E70A41000F7AE6E /* sample6_unittest.cc */,
);
name = samples;
path = ../samples;
sourceTree = SOURCE_ROOT;
};
404884070E2F799B00CF7658 /* src */ = {
isa = PBXGroup;
children = (
404884080E2F799B00CF7658 /* gtest-death-test.cc */,
404884090E2F799B00CF7658 /* gtest-filepath.cc */,
4048840A0E2F799B00CF7658 /* gtest-internal-inl.h */,
4048840B0E2F799B00CF7658 /* gtest-port.cc */,
4048840C0E2F799B00CF7658 /* gtest.cc */,
4048840D0E2F799B00CF7658 /* gtest_main.cc */,
22A865FC0E70A35700F7AE6E /* gtest-typed-test.cc */,
);
name = src;
path = ../src;
sourceTree = SOURCE_ROOT;
};
40D4CDF00E30E07400294801 /* Config */ = {
isa = PBXGroup;
children = (
40D4CDF10E30E07400294801 /* DebugProject.xcconfig */,
40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */,
40D4CDF30E30E07400294801 /* General.xcconfig */,
40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */,
);
path = Config;
sourceTree = "<group>";
};
40D4CF4E0E30F5E200294801 /* Resources */ = {
isa = PBXGroup;
children = (
40D4CF510E30F5E200294801 /* Info.plist */,
);
path = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8D07F2BD0486CC7A007CD1D0 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
404884380E2F799B00CF7658 /* gtest-death-test.h in Headers */,
404884390E2F799B00CF7658 /* gtest-message.h in Headers */,
3BF6F2A50E79B616000F2EEE /* gtest-typed-test.h in Headers */,
4048843A0E2F799B00CF7658 /* gtest-spi.h in Headers */,
4048843B0E2F799B00CF7658 /* gtest.h in Headers */,
4048843C0E2F799B00CF7658 /* gtest_pred_impl.h in Headers */,
4048843D0E2F799B00CF7658 /* gtest_prod.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
22A866010E70A39900F7AE6E /* sample6 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 22A866090E70A39900F7AE6E /* Build configuration list for PBXNativeTarget "sample6" */;
buildPhases = (
22A866040E70A39900F7AE6E /* Sources */,
22A866070E70A39900F7AE6E /* Frameworks */,
);
buildRules = (
);
dependencies = (
22A866020E70A39900F7AE6E /* PBXTargetDependency */,
);
name = sample6;
productName = sample6;
productReference = 22A8660C0E70A39900F7AE6E /* sample6 */;
productType = "com.apple.product-type.tool";
};
404885920E2F814C00CF7658 /* sample1 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4048859E0E2F818900CF7658 /* Build configuration list for PBXNativeTarget "sample1" */;
buildPhases = (
404885900E2F814C00CF7658 /* Sources */,
404885910E2F814C00CF7658 /* Frameworks */,
);
buildRules = (
);
dependencies = (
404885A80E2F824900CF7658 /* PBXTargetDependency */,
);
name = sample1;
productName = sample1;
productReference = 404885930E2F814C00CF7658 /* sample1 */;
productType = "com.apple.product-type.tool";
};
404885B00E2F82BA00CF7658 /* sample2 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 404885B80E2F82BA00CF7658 /* Build configuration list for PBXNativeTarget "sample2" */;
buildPhases = (
404885B30E2F82BA00CF7658 /* Sources */,
404885B60E2F82BA00CF7658 /* Frameworks */,
);
buildRules = (
);
dependencies = (
404885B10E2F82BA00CF7658 /* PBXTargetDependency */,
);
name = sample2;
productName = sample2;
productReference = 404885BB0E2F82BA00CF7658 /* sample2 */;
productType = "com.apple.product-type.tool";
};
404885D40E2F832A00CF7658 /* sample3 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 404885DC0E2F832A00CF7658 /* Build configuration list for PBXNativeTarget "sample3" */;
buildPhases = (
404885D70E2F832A00CF7658 /* Sources */,
404885DA0E2F832A00CF7658 /* Frameworks */,
);
buildRules = (
);
dependencies = (
404885D50E2F832A00CF7658 /* PBXTargetDependency */,
);
name = sample3;
productName = sample3;
productReference = 404885DF0E2F832A00CF7658 /* sample3 */;
productType = "com.apple.product-type.tool";
};
404885E10E2F833000CF7658 /* sample4 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 404885E90E2F833000CF7658 /* Build configuration list for PBXNativeTarget "sample4" */;
buildPhases = (
404885E40E2F833000CF7658 /* Sources */,
404885E70E2F833000CF7658 /* Frameworks */,
);
buildRules = (
);
dependencies = (
404885E20E2F833000CF7658 /* PBXTargetDependency */,
);
name = sample4;
productName = sample4;
productReference = 404885EC0E2F833000CF7658 /* sample4 */;
productType = "com.apple.product-type.tool";
};
404885EE0E2F833400CF7658 /* sample5 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 404885F60E2F833400CF7658 /* Build configuration list for PBXNativeTarget "sample5" */;
buildPhases = (
404885F10E2F833400CF7658 /* Sources */,
404885F40E2F833400CF7658 /* Frameworks */,
);
buildRules = (
);
dependencies = (
404885EF0E2F833400CF7658 /* PBXTargetDependency */,
);
name = sample5;
productName = sample5;
productReference = 404885F90E2F833400CF7658 /* sample5 */;
productType = "com.apple.product-type.tool";
};
8D07F2BC0486CC7A007CD1D0 /* gtest */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "gtest" */;
buildPhases = (
8D07F2C10486CC7A007CD1D0 /* Sources */,
8D07F2C30486CC7A007CD1D0 /* Frameworks */,
8D07F2BD0486CC7A007CD1D0 /* Headers */,
404884A50E2F7C0400CF7658 /* Copy Headers Internal */,
8D07F2BF0486CC7A007CD1D0 /* Resources */,
8D07F2C50486CC7A007CD1D0 /* Rez */,
);
buildRules = (
);
dependencies = (
40C44AE60E379922008FCC51 /* PBXTargetDependency */,
);
name = gtest;
productInstallPath = "$(HOME)/Library/Frameworks";
productName = gtest;
productReference = 8D07F2C80486CC7A007CD1D0 /* gtest.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "gtest" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
Japanese,
French,
German,
en,
);
mainGroup = 0867D691FE84028FC02AAC07 /* gtest */;
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8D07F2BC0486CC7A007CD1D0 /* gtest */,
404885920E2F814C00CF7658 /* sample1 */,
404885B00E2F82BA00CF7658 /* sample2 */,
404885D40E2F832A00CF7658 /* sample3 */,
404885E10E2F833000CF7658 /* sample4 */,
404885EE0E2F833400CF7658 /* sample5 */,
22A866010E70A39900F7AE6E /* sample6 */,
40C44ADC0E3798F4008FCC51 /* Version Info */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404884500E2F799B00CF7658 /* README in Resources */,
404884AC0E2F7CD900CF7658 /* CHANGES in Resources */,
404884AD0E2F7CD900CF7658 /* CONTRIBUTORS in Resources */,
404884AE0E2F7CD900CF7658 /* COPYING in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXRezBuildPhase section */
8D07F2C50486CC7A007CD1D0 /* Rez */ = {
isa = PBXRezBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXRezBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
40C44ADB0E3798F4008FCC51 /* Generate Version.h */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(SRCROOT)/Scripts/versiongenerate.py",
"$(SRCROOT)/../configure.ac",
);
name = "Generate Version.h";
outputPaths = (
"$(DERIVED_FILE_DIR)/Version.h",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Remember, this \"Run Script\" build phase will be executed from $SRCROOT\n/usr/bin/python Scripts/versiongenerate.py ../ $DERIVED_FILE_DIR\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
22A866040E70A39900F7AE6E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
22A866190E70A41000F7AE6E /* sample6_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885900E2F814C00CF7658 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404885990E2F816100CF7658 /* sample1.cc in Sources */,
4048859B0E2F816100CF7658 /* sample1_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885B30E2F82BA00CF7658 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404885CF0E2F82F000CF7658 /* sample2.cc in Sources */,
404885D00E2F82F000CF7658 /* sample2_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885D70E2F832A00CF7658 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404886050E2F83DF00CF7658 /* sample3_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885E40E2F833000CF7658 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404886080E2F840300CF7658 /* sample4.cc in Sources */,
404886090E2F840300CF7658 /* sample4_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
404885F10E2F833400CF7658 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
404886140E2F849100CF7658 /* sample1.cc in Sources */,
4048860C0E2F840E00CF7658 /* sample5_unittest.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
8D07F2C10486CC7A007CD1D0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4048845F0E2F799B00CF7658 /* gtest-death-test.cc in Sources */,
404884600E2F799B00CF7658 /* gtest-filepath.cc in Sources */,
404884620E2F799B00CF7658 /* gtest-port.cc in Sources */,
404884630E2F799B00CF7658 /* gtest.cc in Sources */,
404884640E2F799B00CF7658 /* gtest_main.cc in Sources */,
22A865FD0E70A35700F7AE6E /* gtest-typed-test.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
22A866020E70A39900F7AE6E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 22A866030E70A39900F7AE6E /* PBXContainerItemProxy */;
};
404885A80E2F824900CF7658 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 404885A70E2F824900CF7658 /* PBXContainerItemProxy */;
};
404885B10E2F82BA00CF7658 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 404885B20E2F82BA00CF7658 /* PBXContainerItemProxy */;
};
404885D50E2F832A00CF7658 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 404885D60E2F832A00CF7658 /* PBXContainerItemProxy */;
};
404885E20E2F833000CF7658 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 404885E30E2F833000CF7658 /* PBXContainerItemProxy */;
};
404885EF0E2F833400CF7658 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 8D07F2BC0486CC7A007CD1D0 /* gtest */;
targetProxy = 404885F00E2F833400CF7658 /* PBXContainerItemProxy */;
};
40C44AE60E379922008FCC51 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 40C44ADC0E3798F4008FCC51 /* Version Info */;
targetProxy = 40C44AE50E379922008FCC51 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
22A8660A0E70A39900F7AE6E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample6;
};
name = Debug;
};
22A8660B0E70A39900F7AE6E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample6;
};
name = Release;
};
404885950E2F814C00CF7658 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample1;
};
name = Debug;
};
404885960E2F814C00CF7658 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample1;
};
name = Release;
};
404885B90E2F82BA00CF7658 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample2;
};
name = Debug;
};
404885BA0E2F82BA00CF7658 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample2;
};
name = Release;
};
404885DD0E2F832A00CF7658 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample3;
};
name = Debug;
};
404885DE0E2F832A00CF7658 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample3;
};
name = Release;
};
404885EA0E2F833000CF7658 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample4;
};
name = Debug;
};
404885EB0E2F833000CF7658 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample4;
};
name = Release;
};
404885F70E2F833400CF7658 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample5;
};
name = Debug;
};
404885F80E2F833400CF7658 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INSTALL_PATH = /usr/local/bin;
PRODUCT_NAME = sample5;
};
name = Release;
};
40C44ADF0E3798F4008FCC51 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = gtest;
TARGET_NAME = gtest;
};
name = Debug;
};
40C44AE00E3798F4008FCC51 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = gtest;
TARGET_NAME = gtest;
};
name = Release;
};
4FADC24308B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */;
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
HEADER_SEARCH_PATHS = (
../include/,
../,
);
INFOPLIST_FILE = Resources/Info.plist;
INFOPLIST_PREFIX_HEADER = "$(DERIVED_FILE_DIR)/Version.h";
INFOPLIST_PREPROCESS = YES;
PRODUCT_NAME = gtest;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
4FADC24408B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 40D4CDF20E30E07400294801 /* FrameworkTarget.xcconfig */;
buildSettings = {
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
HEADER_SEARCH_PATHS = (
../include/,
../,
);
INFOPLIST_FILE = Resources/Info.plist;
INFOPLIST_PREFIX_HEADER = "$(DERIVED_FILE_DIR)/Version.h";
INFOPLIST_PREPROCESS = YES;
PRODUCT_NAME = gtest;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
4FADC24708B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 40D4CDF10E30E07400294801 /* DebugProject.xcconfig */;
buildSettings = {
};
name = Debug;
};
4FADC24808B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */;
buildSettings = {
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
22A866090E70A39900F7AE6E /* Build configuration list for PBXNativeTarget "sample6" */ = {
isa = XCConfigurationList;
buildConfigurations = (
22A8660A0E70A39900F7AE6E /* Debug */,
22A8660B0E70A39900F7AE6E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4048859E0E2F818900CF7658 /* Build configuration list for PBXNativeTarget "sample1" */ = {
isa = XCConfigurationList;
buildConfigurations = (
404885950E2F814C00CF7658 /* Debug */,
404885960E2F814C00CF7658 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
404885B80E2F82BA00CF7658 /* Build configuration list for PBXNativeTarget "sample2" */ = {
isa = XCConfigurationList;
buildConfigurations = (
404885B90E2F82BA00CF7658 /* Debug */,
404885BA0E2F82BA00CF7658 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
404885DC0E2F832A00CF7658 /* Build configuration list for PBXNativeTarget "sample3" */ = {
isa = XCConfigurationList;
buildConfigurations = (
404885DD0E2F832A00CF7658 /* Debug */,
404885DE0E2F832A00CF7658 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
404885E90E2F833000CF7658 /* Build configuration list for PBXNativeTarget "sample4" */ = {
isa = XCConfigurationList;
buildConfigurations = (
404885EA0E2F833000CF7658 /* Debug */,
404885EB0E2F833000CF7658 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
404885F60E2F833400CF7658 /* Build configuration list for PBXNativeTarget "sample5" */ = {
isa = XCConfigurationList;
buildConfigurations = (
404885F70E2F833400CF7658 /* Debug */,
404885F80E2F833400CF7658 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
40C44AE40E379905008FCC51 /* Build configuration list for PBXAggregateTarget "Version Info" */ = {
isa = XCConfigurationList;
buildConfigurations = (
40C44ADF0E3798F4008FCC51 /* Debug */,
40C44AE00E3798F4008FCC51 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "gtest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24308B4156D00ABE55E /* Debug */,
4FADC24408B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "gtest" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24708B4156D00ABE55E /* Debug */,
4FADC24808B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}