Commit 451223a3 authored by Kenton Varda's avatar Kenton Varda

Bundle gtest into autotool build, simplifying usage.

parent 18608f7b
......@@ -24,6 +24,9 @@
# setup-ekam.sh
/c++/.ekam
# setup-autotools.sh
/c++/gtest
# Jekyll-generated site
/doc/_site
......
......@@ -4,6 +4,35 @@ ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
# Always include gtest in distributions.
DIST_SUBDIRS = $(subdirs)
# Build gtest before we build Cap'n Proto tests. We don't add gtest to SUBDIRS
# because then "make check" would also build and run all of gtest's own tests,
# which takes a lot of time and is generally not useful to us. Also, we don't
# want "make install" to recurse into gtest since we don't want to overwrite
# the installed version of gtest if there is one (and, actually, gtest doesn't
# even support "make install" anyway). So we define a rule such that it will
# only be built when needed.
gtest/lib/libgtest.la:
@echo "Making lib/libgtest.a lib/libgtest_main.a in gtest"
@cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
gtest/lib/libgtest_main.la: gtest/lib/libgtest.la
@:
# We would like to clean gtest when "make clean" is invoked. But we have to
# be careful because clean-local is also invoked during "make distclean", but
# "make distclean" already recurses into gtest because it's listed among the
# DIST_SUBDIRS. distclean will delete gtest/Makefile, so if we then try to
# cd to the directory again and "make clean" it will fail. So, check that the
# Makefile exists before recursing.
clean-local:
@if test -e gtest/Makefile; then \
echo "Making clean in gtest"; \
cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
fi
AM_CXXFLAGS = -I$(srcdir)/src -I$(builddir)/src
EXTRA_DIST = \
......@@ -97,12 +126,10 @@ includecapnp_HEADERS = \
nodist_includecapnp_HEADERS = \
src/capnp/schema.capnp.h
# No dynamic library for now since C++ binary compatibility is hard.
# It may make more sense to have every module statically link Cap'n Proto
# and pass around messages via memory pointers.
lib_LIBRARIES = libcapnp.a
lib_LTLIBRARIES = libcapnp.la
libcapnp_a_SOURCES= \
libcapnp_la_LDFLAGS = -release $(VERSION) -export-dynamic -no-undefined
libcapnp_la_SOURCES= \
src/kj/common.c++ \
src/kj/units.c++ \
src/kj/memory.c++ \
......@@ -123,7 +150,7 @@ libcapnp_a_SOURCES= \
src/capnp/stringify.c++ \
src/capnp/serialize.c++ \
src/capnp/serialize-packed.c++
nodist_libcapnp_a_SOURCES = \
nodist_libcapnp_la_SOURCES = \
src/capnp/schema.capnp.c++ \
src/capnp/c++.capnp.c++
......@@ -147,7 +174,8 @@ test_capnpc_outputs = \
BUILT_SOURCES = $(test_capnpc_outputs) $(capnpc_outputs)
check_PROGRAMS = capnp-test
capnp_test_LDADD = -lgtest -lgtest_main libcapnp.a
capnp_test_LDADD = gtest/lib/libgtest.la gtest/lib/libgtest_main.la libcapnp.la
capnp_test_CPPFLAGS = -Igtest/include -I$(srcdir)/gtest/include
capnp_test_SOURCES = \
src/kj/common-test.c++ \
src/kj/memory-test.c++ \
......
......@@ -23,13 +23,18 @@ AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_11([noext])
ACX_PTHREAD
AC_PROG_LIBTOOL
LIBS="$PTHREAD_LIBS $LIBS"
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# We need gtest to use the same CXXFLAGS, especially -std and -stdlib, so export them before
# configuring gtest.
export CXXFLAGS
AC_CONFIG_SUBDIRS([gtest])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Index: include/gtest/gtest-printers.h
===================================================================
--- include/gtest/gtest-printers.h (revision 655)
+++ include/gtest/gtest-printers.h (working copy)
@@ -481,7 +481,7 @@
#endif // GTEST_HAS_STD_WSTRING
#if GTEST_HAS_TR1_TUPLE
-// Overload for ::std::tr1::tuple. Needed for printing function arguments,
+// Overload for ::std::tuple. Needed for printing function arguments,
// which are packed as tuples.
// Helper function for printing a tuple. T must be instantiated with
@@ -494,60 +494,60 @@
// regardless of whether tr1::tuple is implemented using the
// non-standard variadic template feature or not.
-inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
+inline void PrintTo(const ::std::tuple<>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1>
-void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2>
-void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2, T3>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
+void PrintTo(const ::std::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
-void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
+void PrintTo(const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
@@ -555,7 +555,7 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
void PrintTo(
- const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
+ const ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
::std::ostream* os) {
PrintTupleTo(t, os);
}
@@ -715,8 +715,8 @@
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
*os << ", ";
- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
- ::Print(::std::tr1::get<N - 1>(t), os);
+ UniversalPrinter<typename ::std::tuple_element<N - 1, Tuple>::type>
+ ::Print(::std::get<N - 1>(t), os);
}
// Tersely prints the first N fields of a tuple to a string vector,
@@ -725,7 +725,7 @@
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
+ UniversalTersePrint(::std::get<N - 1>(t), &ss);
strings->push_back(ss.str());
}
};
@@ -748,14 +748,14 @@
struct TuplePrefixPrinter<1> {
template <typename Tuple>
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
- Print(::std::tr1::get<0>(t), os);
+ UniversalPrinter<typename ::std::tuple_element<0, Tuple>::type>::
+ Print(::std::get<0>(t), os);
}
template <typename Tuple>
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<0>(t), &ss);
+ UniversalTersePrint(::std::get<0>(t), &ss);
strings->push_back(ss.str());
}
};
@@ -765,7 +765,7 @@
template <typename T>
void PrintTupleTo(const T& t, ::std::ostream* os) {
*os << "(";
- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
+ TuplePrefixPrinter< ::std::tuple_size<T>::value>::
PrintPrefixTo(t, os);
*os << ")";
}
@@ -776,7 +776,7 @@
template <typename Tuple>
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
Strings result;
- TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
+ TuplePrefixPrinter< ::std::tuple_size<Tuple>::value>::
TersePrintPrefixToStrings(value, &result);
return result;
}
Index: include/gtest/internal/gtest-param-util-generated.h.pump
===================================================================
--- include/gtest/internal/gtest-param-util-generated.h.pump (revision 655)
+++ include/gtest/internal/gtest-param-util-generated.h.pump (working copy)
@@ -128,9 +128,9 @@
template <$for j, [[typename T$j]]>
class CartesianProductGenerator$i
- : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > {
+ : public ParamGeneratorInterface< ::std::tuple<$for j, [[T$j]]> > {
public:
- typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType;
+ typedef ::std::tuple<$for j, [[T$j]]> ParamType;
CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
: $for j, [[g$(j)_(g$j)]] {}
@@ -269,8 +269,8 @@
CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
: $for j, [[g$(j)_(g$j)]] {}
template <$for j, [[typename T$j]]>
- operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const {
- return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >(
+ operator ParamGenerator< ::std::tuple<$for j, [[T$j]]> >() const {
+ return ParamGenerator< ::std::tuple<$for j, [[T$j]]> >(
new CartesianProductGenerator$i<$for j, [[T$j]]>(
$for j,[[
Index: include/gtest/internal/gtest-tuple.h
===================================================================
--- include/gtest/internal/gtest-tuple.h (revision 655)
+++ include/gtest/internal/gtest-tuple.h (working copy)
@@ -119,7 +119,7 @@
struct ByRef<T&> { typedef T& type; }; // NOLINT
// A handy wrapper for ByRef.
-#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+#define GTEST_BY_REF_(T) typename ::std::gtest_internal::ByRef<T>::type
// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
// is the same as tr1::add_reference<T>::type.
@@ -129,7 +129,7 @@
struct AddRef<T&> { typedef T& type; }; // NOLINT
// A handy wrapper for AddRef.
-#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+#define GTEST_ADD_REF_(T) typename ::std::gtest_internal::AddRef<T>::type
// A helper for implementing get<k>().
template <int k> class Get;
@@ -639,7 +639,7 @@
// 6.1.3.2 Tuple creation functions.
// Known limitations: we don't support passing an
-// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
+// std::reference_wrapper<T> to make_tuple(). And we don't
// implement tie().
inline tuple<> make_tuple() { return tuple<>(); }
@@ -912,7 +912,7 @@
template <class Tuple1, class Tuple2>
static bool Eq(const Tuple1& t1, const Tuple2& t2) {
return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
- ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+ ::std::get<k - 1>(t1) == ::std::get<k - 1>(t2);
}
};
Index: include/gtest/internal/gtest-param-util-generated.h
===================================================================
--- include/gtest/internal/gtest-param-util-generated.h (revision 655)
+++ include/gtest/internal/gtest-param-util-generated.h (working copy)
@@ -2836,9 +2836,9 @@
//
template <typename T1, typename T2>
class CartesianProductGenerator2
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2> > {
public:
- typedef ::std::tr1::tuple<T1, T2> ParamType;
+ typedef ::std::tuple<T1, T2> ParamType;
CartesianProductGenerator2(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2)
@@ -2951,9 +2951,9 @@
template <typename T1, typename T2, typename T3>
class CartesianProductGenerator3
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
+ typedef ::std::tuple<T1, T2, T3> ParamType;
CartesianProductGenerator3(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
@@ -3083,9 +3083,9 @@
template <typename T1, typename T2, typename T3, typename T4>
class CartesianProductGenerator4
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4> ParamType;
CartesianProductGenerator4(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3234,9 +3234,9 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5>
class CartesianProductGenerator5
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5> ParamType;
CartesianProductGenerator5(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3402,10 +3402,10 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
class CartesianProductGenerator6
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5,
T6> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6> ParamType;
CartesianProductGenerator6(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3588,10 +3588,10 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
class CartesianProductGenerator7
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
CartesianProductGenerator7(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3791,10 +3791,10 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
class CartesianProductGenerator8
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
CartesianProductGenerator8(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4013,10 +4013,10 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
class CartesianProductGenerator9
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
CartesianProductGenerator9(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4252,10 +4252,10 @@
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
class CartesianProductGenerator10
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9, T10> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+ typedef ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
CartesianProductGenerator10(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4517,8 +4517,8 @@
CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
: g1_(g1), g2_(g2) {}
template <typename T1, typename T2>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
+ operator ParamGenerator< ::std::tuple<T1, T2> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2> >(
new CartesianProductGenerator2<T1, T2>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_)));
@@ -4539,8 +4539,8 @@
const Generator3& g3)
: g1_(g1), g2_(g2), g3_(g3) {}
template <typename T1, typename T2, typename T3>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3> >(
new CartesianProductGenerator3<T1, T2, T3>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4564,8 +4564,8 @@
const Generator3& g3, const Generator4& g4)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
template <typename T1, typename T2, typename T3, typename T4>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4> >(
new CartesianProductGenerator4<T1, T2, T3, T4>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4591,8 +4591,8 @@
const Generator3& g3, const Generator4& g4, const Generator5& g5)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5> >(
new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4622,8 +4622,8 @@
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6> >() const {
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6> >(
new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4655,9 +4655,9 @@
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6,
T7> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7> >(
new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4693,9 +4693,9 @@
g8_(g8) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7,
T8> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -4734,9 +4734,9 @@
g9_(g9) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >(
new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
static_cast<ParamGenerator<T1> >(g1_),
@@ -4778,9 +4778,9 @@
g9_(g9), g10_(g10) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ operator ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9, T10> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ return ParamGenerator< ::std::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9, T10> >(
new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
T10>(
Index: include/gtest/internal/gtest-tuple.h.pump
===================================================================
--- include/gtest/internal/gtest-tuple.h.pump (revision 655)
+++ include/gtest/internal/gtest-tuple.h.pump (working copy)
@@ -95,7 +95,7 @@
struct ByRef<T&> { typedef T& type; }; // NOLINT
// A handy wrapper for ByRef.
-#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+#define GTEST_BY_REF_(T) typename ::std::gtest_internal::ByRef<T>::type
// AddRef<T>::type is T if T is a reference; otherwise it's T&. This
// is the same as tr1::add_reference<T>::type.
@@ -105,7 +105,7 @@
struct AddRef<T&> { typedef T& type; }; // NOLINT
// A handy wrapper for AddRef.
-#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+#define GTEST_ADD_REF_(T) typename ::std::gtest_internal::AddRef<T>::type
// A helper for implementing get<k>().
template <int k> class Get;
@@ -198,7 +198,7 @@
// 6.1.3.2 Tuple creation functions.
// Known limitations: we don't support passing an
-// std::tr1::reference_wrapper<T> to make_tuple(). And we don't
+// std::reference_wrapper<T> to make_tuple(). And we don't
// implement tie().
inline tuple<> make_tuple() { return tuple<>(); }
@@ -292,7 +292,7 @@
template <class Tuple1, class Tuple2>
static bool Eq(const Tuple1& t1, const Tuple2& t2) {
return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
- ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+ ::std::get<k - 1>(t1) == ::std::get<k - 1>(t2);
}
};
Index: include/gtest/internal/gtest-port.h
===================================================================
--- include/gtest/internal/gtest-port.h (revision 655)
+++ include/gtest/internal/gtest-port.h (working copy)
@@ -482,21 +482,21 @@
# include <tuple>
# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
-// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
+// GCC 4.0+ implements tr1/tuple in the <tuple> header. This does
// not conform to the TR1 spec, which requires the header to be <tuple>.
# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
-// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
-// which is #included by <tr1/tuple>, to not compile when RTTI is
+// Until version 4.3.2, gcc has a bug that causes <functional>,
+// which is #included by <tuple>, to not compile when RTTI is
// disabled. _TR1_FUNCTIONAL is the header guard for
-// <tr1/functional>. Hence the following #define is a hack to prevent
-// <tr1/functional> from being included.
+// <functional>. Hence the following #define is a hack to prevent
+// <functional> from being included.
# define _TR1_FUNCTIONAL 1
-# include <tr1/tuple>
+# include <tuple>
# undef _TR1_FUNCTIONAL // Allows the user to #include
- // <tr1/functional> if he chooses to.
+ // <functional> if he chooses to.
# else
-# include <tr1/tuple> // NOLINT
+# include <tuple> // NOLINT
# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
# else
Index: samples/sample8_unittest.cc
===================================================================
--- samples/sample8_unittest.cc (revision 655)
+++ samples/sample8_unittest.cc (working copy)
@@ -90,7 +90,7 @@
// PreCalculatedPrimeTable disabled. We do this by defining fixture which will
// accept different combinations of parameters for instantiating a
// HybridPrimeTable instance.
-class PrimeTableTest : public TestWithParam< ::std::tr1::tuple<bool, int> > {
+class PrimeTableTest : public TestWithParam< ::std::tuple<bool, int> > {
protected:
virtual void SetUp() {
// This can be written as
@@ -99,10 +99,10 @@
// int max_precalculated;
// tie(force_on_the_fly, max_precalculated) = GetParam();
//
- // once the Google C++ Style Guide allows use of ::std::tr1::tie.
+ // once the Google C++ Style Guide allows use of ::std::tie.
//
- bool force_on_the_fly = ::std::tr1::get<0>(GetParam());
- int max_precalculated = ::std::tr1::get<1>(GetParam());
+ bool force_on_the_fly = ::std::get<0>(GetParam());
+ int max_precalculated = ::std::get<1>(GetParam());
table_ = new HybridPrimeTable(force_on_the_fly, max_precalculated);
}
virtual void TearDown() {
Index: test/gtest-param-test_test.cc
===================================================================
--- test/gtest-param-test_test.cc (revision 655)
+++ test/gtest-param-test_test.cc (working copy)
@@ -64,9 +64,9 @@
# if GTEST_HAS_COMBINE
using ::testing::Combine;
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
+using ::std::get;
+using ::std::make_tuple;
+using ::std::tuple;
# endif // GTEST_HAS_COMBINE
using ::testing::internal::ParamGenerator;
Index: test/gtest-port_test.cc
===================================================================
--- test/gtest-port_test.cc (revision 655)
+++ test/gtest-port_test.cc (working copy)
@@ -963,23 +963,23 @@
}
TEST(ThreadLocalTest, GetAndPointerReturnSameValue) {
- ThreadLocal<String> thread_local;
+ ThreadLocal<String> thread_local_;
- EXPECT_EQ(thread_local.pointer(), &(thread_local.get()));
+ EXPECT_EQ(thread_local_.pointer(), &(thread_local_.get()));
// Verifies the condition still holds after calling set.
- thread_local.set("foo");
- EXPECT_EQ(thread_local.pointer(), &(thread_local.get()));
+ thread_local_.set("foo");
+ EXPECT_EQ(thread_local_.pointer(), &(thread_local_.get()));
}
TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
- ThreadLocal<String> thread_local;
- const ThreadLocal<String>& const_thread_local = thread_local;
+ ThreadLocal<String> thread_local_;
+ const ThreadLocal<String>& const_thread_local_ = thread_local_;
- EXPECT_EQ(thread_local.pointer(), const_thread_local.pointer());
+ EXPECT_EQ(thread_local_.pointer(), const_thread_local_.pointer());
- thread_local.set("foo");
- EXPECT_EQ(thread_local.pointer(), const_thread_local.pointer());
+ thread_local_.set("foo");
+ EXPECT_EQ(thread_local_.pointer(), const_thread_local_.pointer());
}
#if GTEST_IS_THREADSAFE
@@ -1088,14 +1088,14 @@
}
TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) {
- ThreadLocal<String> thread_local("foo");
- EXPECT_STREQ("foo", thread_local.get().c_str());
+ ThreadLocal<String> thread_local_("foo");
+ EXPECT_STREQ("foo", thread_local_.get().c_str());
- thread_local.set("bar");
- EXPECT_STREQ("bar", thread_local.get().c_str());
+ thread_local_.set("bar");
+ EXPECT_STREQ("bar", thread_local_.get().c_str());
String result;
- RunFromThread(&RetrieveThreadLocalValue, make_pair(&thread_local, &result));
+ RunFromThread(&RetrieveThreadLocalValue, make_pair(&thread_local_, &result));
EXPECT_STREQ("foo", result.c_str());
}
@@ -1124,8 +1124,8 @@
typedef ThreadLocal<DestructorTracker>* ThreadParam;
-void CallThreadLocalGet(ThreadParam thread_local) {
- thread_local->get();
+void CallThreadLocalGet(ThreadParam thread_local_) {
+ thread_local_->get();
}
// Tests that when a ThreadLocal object dies in a thread, it destroys
@@ -1135,19 +1135,19 @@
{
// The next line default constructs a DestructorTracker object as
- // the default value of objects managed by thread_local.
- ThreadLocal<DestructorTracker> thread_local;
+ // the default value of objects managed by thread_local_.
+ ThreadLocal<DestructorTracker> thread_local_;
ASSERT_EQ(1U, g_destroyed.size());
ASSERT_FALSE(g_destroyed[0]);
// This creates another DestructorTracker object for the main thread.
- thread_local.get();
+ thread_local_.get();
ASSERT_EQ(2U, g_destroyed.size());
ASSERT_FALSE(g_destroyed[0]);
ASSERT_FALSE(g_destroyed[1]);
}
- // Now thread_local has died. It should have destroyed both the
+ // Now thread_local_ has died. It should have destroyed both the
// default value shared by all threads and the value for the main
// thread.
ASSERT_EQ(2U, g_destroyed.size());
@@ -1164,14 +1164,14 @@
{
// The next line default constructs a DestructorTracker object as
- // the default value of objects managed by thread_local.
- ThreadLocal<DestructorTracker> thread_local;
+ // the default value of objects managed by thread_local_.
+ ThreadLocal<DestructorTracker> thread_local_;
ASSERT_EQ(1U, g_destroyed.size());
ASSERT_FALSE(g_destroyed[0]);
// This creates another DestructorTracker object in the new thread.
ThreadWithParam<ThreadParam> thread(
- &CallThreadLocalGet, &thread_local, NULL);
+ &CallThreadLocalGet, &thread_local_, NULL);
thread.Join();
// Now the new thread has exited. The per-thread object for it
@@ -1181,7 +1181,7 @@
ASSERT_TRUE(g_destroyed[1]);
}
- // Now thread_local has died. The default value should have been
+ // Now thread_local_ has died. The default value should have been
// destroyed too.
ASSERT_EQ(2U, g_destroyed.size());
EXPECT_TRUE(g_destroyed[0]);
@@ -1191,12 +1191,12 @@
}
TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) {
- ThreadLocal<String> thread_local;
- thread_local.set("Foo");
- EXPECT_STREQ("Foo", thread_local.get().c_str());
+ ThreadLocal<String> thread_local_;
+ thread_local_.set("Foo");
+ EXPECT_STREQ("Foo", thread_local_.get().c_str());
String result;
- RunFromThread(&RetrieveThreadLocalValue, make_pair(&thread_local, &result));
+ RunFromThread(&RetrieveThreadLocalValue, make_pair(&thread_local_, &result));
EXPECT_TRUE(result.c_str() == NULL);
}
Index: test/gtest-tuple_test.cc
===================================================================
--- test/gtest-tuple_test.cc (revision 655)
+++ test/gtest-tuple_test.cc (working copy)
@@ -35,11 +35,11 @@
namespace {
-using ::std::tr1::get;
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
-using ::std::tr1::tuple_element;
-using ::std::tr1::tuple_size;
+using ::std::get;
+using ::std::make_tuple;
+using ::std::tuple;
+using ::std::tuple_element;
+using ::std::tuple_size;
using ::testing::StaticAssertTypeEq;
// Tests that tuple_element<K, tuple<T0, T1, ..., TN> >::type returns TK.
Index: test/gtest-printers_test.cc
===================================================================
--- test/gtest-printers_test.cc (revision 655)
+++ test/gtest-printers_test.cc (working copy)
@@ -208,8 +208,8 @@
using ::testing::internal::string;
#if GTEST_HAS_TR1_TUPLE
-using ::std::tr1::make_tuple;
-using ::std::tr1::tuple;
+using ::std::make_tuple;
+using ::std::tuple;
#endif
#if _MSC_VER
#! /bin/bash
set -euo pipefail
if [ ! -e gtest ]; then
echo "================================================================================"
echo "Fetching Google Test code..."
echo "================================================================================"
svn checkout http://googletest.googlecode.com/svn/tags/release-1.6.0 gtest
echo "================================================================================"
echo "Patching Google Test for C++11..."
echo "================================================================================"
cd gtest
patch -p0 < ../gtest-1.6.0-c++11.patch
cd ..
fi
echo "================================================================================"
echo "Done"
echo "================================================================================"
echo
echo "Ready to run autoreconf. For example:"
echo " autoreconf -i && ./configure && make -j6 check && sudo make install"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment