nodist_demangle_unittest_OBJECTS = $(am__objects_1)
demangle_unittest_OBJECTS = $(am_demangle_unittest_OBJECTS) \
$(nodist_demangle_unittest_OBJECTS)
-demangle_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2)
+am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+demangle_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
demangle_unittest_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(demangle_unittest_CXXFLAGS) $(CXXFLAGS) \
nodist_logging_unittest_OBJECTS = $(am__objects_1)
logging_unittest_OBJECTS = $(am_logging_unittest_OBJECTS) \
$(nodist_logging_unittest_OBJECTS)
-logging_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2)
+logging_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
logging_unittest_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(logging_unittest_CXXFLAGS) $(CXXFLAGS) \
nodist_symbolize_unittest_OBJECTS = $(am__objects_1)
symbolize_unittest_OBJECTS = $(am_symbolize_unittest_OBJECTS) \
$(nodist_symbolize_unittest_OBJECTS)
-symbolize_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2)
+symbolize_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
symbolize_unittest_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(symbolize_unittest_CXXFLAGS) $(CXXFLAGS) \
nodist_utilities_unittest_OBJECTS = $(am__objects_1)
utilities_unittest_OBJECTS = $(am_utilities_unittest_OBJECTS) \
$(nodist_utilities_unittest_OBJECTS)
-utilities_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2)
+utilities_unittest_DEPENDENCIES = libglog.la $(am__DEPENDENCIES_2) \
+ $(am__DEPENDENCIES_3)
utilities_unittest_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) \
$(utilities_unittest_CXXFLAGS) $(CXXFLAGS) \
F77 = @F77@
FFLAGS = @FFLAGS@
GFLAGS_LIBS = @GFLAGS_LIBS@
+GMOCK_LIBS = @GMOCK_LIBS@
GREP = @GREP@
+GTEST_LIBS = @GTEST_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
# The libraries libglog depends on.
COMMON_LIBS = $(PTHREAD_LIBS) $(GFLAGS_LIBS) $(UNWIND_LIBS)
+# Libraries for our unittest.
+TEST_LIBS = $(GTEST_LIBS) $(GMOCK_LIBS)
TESTS_ENVIRONMENT =
check_SCRIPTS = logging_striplog_test_sh demangle_unittest_sh \
signalhandler_unittest_sh
nodist_logging_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
logging_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
logging_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
-logging_unittest_LDADD = libglog.la $(COMMON_LIBS)
+logging_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
logging_striptest0_SOURCES = $(gloginclude_HEADERS) \
src/logging_striptest_main.cc
nodist_demangle_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
demangle_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
demangle_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
-demangle_unittest_LDADD = libglog.la $(COMMON_LIBS)
+demangle_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
stacktrace_unittest_SOURCES = $(gloginclude_HEADERS) \
src/stacktrace_unittest.cc
nodist_symbolize_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
symbolize_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
symbolize_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
-symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS)
+symbolize_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
stl_logging_unittest_SOURCES = $(gloginclude_HEADERS) \
src/stl_logging_unittest.cc
nodist_utilities_unittest_SOURCES = $(nodist_gloginclude_HEADERS)
utilities_unittest_CXXFLAGS = $(PTHREAD_CFLAGS)
utilities_unittest_LDFLAGS = $(PTHREAD_CFLAGS)
-utilities_unittest_LDADD = libglog.la $(COMMON_LIBS)
+utilities_unittest_LDADD = libglog.la $(COMMON_LIBS) $(TEST_LIBS)
libglog_la_SOURCES = $(gloginclude_HEADERS) \
src/logging.cc src/raw_logging.cc src/vlog_is_on.cc \
src/utilities.cc src/utilities.h \
ac_cv_have___uint16
ac_cv_have_libgflags
GFLAGS_LIBS
+GTEST_LIBS
+GMOCK_LIBS
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5067 "configure"' > conftest.$ac_ext
+ echo '#line 5069 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7422: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7424: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7426: \$? = $ac_status" >&5
+ echo "$as_me:7428: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7712: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7714: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7716: \$? = $ac_status" >&5
+ echo "$as_me:7718: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7816: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7818: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7820: \$? = $ac_status" >&5
+ echo "$as_me:7822: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10193 "configure"
+#line 10195 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10293 "configure"
+#line 10295 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12694: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12696: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12698: \$? = $ac_status" >&5
+ echo "$as_me:12700: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12798: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12800: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12802: \$? = $ac_status" >&5
+ echo "$as_me:12804: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14396: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14398: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14400: \$? = $ac_status" >&5
+ echo "$as_me:14402: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14500: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14502: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14504: \$? = $ac_status" >&5
+ echo "$as_me:14506: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16720: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16722: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16724: \$? = $ac_status" >&5
+ echo "$as_me:16726: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17010: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17012: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17014: \$? = $ac_status" >&5
+ echo "$as_me:17016: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17114: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17116: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17118: \$? = $ac_status" >&5
+ echo "$as_me:17120: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
GFLAGS_LIBS=
fi
+# Check if there is gtest library installed.
+{ echo "$as_me:$LINENO: checking for main in -lgtest" >&5
+echo $ECHO_N "checking for main in -lgtest... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gtest_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgtest $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gtest_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gtest_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gtest_main" >&5
+echo "${ECHO_T}$ac_cv_lib_gtest_main" >&6; }
+if test $ac_cv_lib_gtest_main = yes; then
+ ac_cv_have_libgtest=1
+else
+ ac_cv_have_libgtest=0
+fi
+
+if test x"$ac_cv_have_libgtest" = x"1"; then
+ GTEST_LIBS=-lgtest
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIB_GTEST 1
+_ACEOF
+
+
+ # Check if there is gmock library installed.
+ { echo "$as_me:$LINENO: checking for main in -lgmock" >&5
+echo $ECHO_N "checking for main in -lgmock... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gmock_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgmock $GTEST_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gmock_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gmock_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gmock_main" >&5
+echo "${ECHO_T}$ac_cv_lib_gmock_main" >&6; }
+if test $ac_cv_lib_gmock_main = yes; then
+ ac_cv_have_libgmock=1
+else
+ ac_cv_have_libgmock=0
+fi
+
+ if test x"$ac_cv_have_libgmock" = x"1"; then
+ GMOCK_LIBS=-lgmock
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIB_GMOCK 1
+_ACEOF
+
+ else
+ GMOCK_LIBS=
+ fi
+else
+ GTEST_LIBS=
+fi
+
# We want to link in libunwind if it exists
UNWIND_LIBS=
# Unfortunately, we need to check the header file in addition to the
+
+
# Write generated configuration file
ac_config_files="$ac_config_files Makefile src/glog/logging.h src/glog/raw_logging.h src/glog/vlog_is_on.h src/glog/stl_logging.h"
ac_cv_have___uint16!$ac_cv_have___uint16$ac_delim
ac_cv_have_libgflags!$ac_cv_have_libgflags$ac_delim
GFLAGS_LIBS!$GFLAGS_LIBS$ac_delim
+GTEST_LIBS!$GTEST_LIBS$ac_delim
+GMOCK_LIBS!$GMOCK_LIBS$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 37; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 39; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
DEFINE_int32(benchmark_iters, 1000000, "Number of iterations per benchmark");
#endif
+#ifdef HAVE_LIB_GTEST
+# include <gtest/gtest.h>
+// Use our ASSERT_DEATH implementation.
+# undef ASSERT_DEATH
+# undef ASSERT_DEBUG_DEATH
+using testing::InitGoogleTest;
+#else
+
_START_GOOGLE_NAMESPACE_
+void InitGoogleTest(int* argc, char** argv) {}
+
// The following is some bare-bones testing infrastructure
#define EXPECT_TRUE(cond) \
} \
} while (0)
+vector<void (*)()> g_testlist; // the tests to run
+
+#define TEST(a, b) \
+ struct Test_##a##_##b { \
+ Test_##a##_##b() { g_testlist.push_back(&Run); } \
+ static void Run() { FlagSaver fs; RunTest(); } \
+ static void RunTest(); \
+ }; \
+ static Test_##a##_##b g_test_##a##_##b; \
+ void Test_##a##_##b::RunTest()
+
+
+static int RUN_ALL_TESTS() {
+ vector<void (*)()>::const_iterator it;
+ for (it = g_testlist.begin(); it != g_testlist.end(); ++it) {
+ (*it)();
+ }
+ fprintf(stderr, "Passed %d tests\n\nPASS\n", (int)g_testlist.size());
+ return 0;
+}
+
+_END_GOOGLE_NAMESPACE_
+
+#endif
+
+_START_GOOGLE_NAMESPACE_
+
static bool g_called_abort;
static jmp_buf g_jmp_buf;
static void CalledAbort() {
#define ASSERT_DEBUG_DEATH(fn, msg) ASSERT_DEATH(fn, msg)
#endif // NDEBUG
-vector<void (*)()> g_testlist; // the tests to run
-
-#define TEST(a, b) \
- struct Test_##a##_##b { \
- Test_##a##_##b() { g_testlist.push_back(&Run); } \
- static void Run() { FlagSaver fs; RunTest(); } \
- static void RunTest(); \
- }; \
- static Test_##a##_##b g_test_##a##_##b; \
- void Test_##a##_##b::RunTest()
-
-
-static int RUN_ALL_TESTS() {
- vector<void (*)()>::const_iterator it;
- for (it = g_testlist.begin(); it != g_testlist.end(); ++it) {
- (*it)();
- }
- fprintf(stderr, "Passed %d tests\n\nPASS\n", (int)g_testlist.size());
- return 0;
-}
-
// Benchmark tools.
#define BENCHMARK(n) static BenchmarkRegisterer __benchmark_ ## n (#n, &n);