Merge lp:~mordred/gearmand/add-gtest into lp:gearmand/1.0

Proposed by Monty Taylor
Status: Merged
Merged at revision: 362
Proposed branch: lp:~mordred/gearmand/add-gtest
Merge into: lp:gearmand/1.0
Diff against target: 121 lines (+50/-2)
6 files modified
.bzrignore (+2/-0)
Makefile.am (+4/-0)
configure.ac (+1/-1)
tests/include.am (+1/-1)
unittests/include.am (+21/-0)
unittests/main.cc (+21/-0)
To merge this branch: bzr merge lp:~mordred/gearmand/add-gtest
Reviewer Review Type Date Requested Status
Brian Aker Pending
Review via email: mp+28907@code.launchpad.net

This proposal supersedes a proposal from 2010-06-29.

Description of the change

adds gtest support

To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote :

Applied changes from libmemcached.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-04-04 21:27:36 +0000
3+++ .bzrignore 2010-06-30 19:08:26 +0000
4@@ -76,3 +76,5 @@
5 tests/tokyocabinet_test.res
6 tests/worker_test
7 tests/worker_test.res
8+tests/unittests
9+unittests/unittests
10
11=== modified file 'Makefile.am'
12--- Makefile.am 2010-01-28 21:37:08 +0000
13+++ Makefile.am 2010-06-30 19:08:26 +0000
14@@ -17,6 +17,7 @@
15 noinst_HEADERS =
16 EXTRA_DIST =
17 CLEANFILES =
18+TESTS =
19
20
21 include benchmark/include.am
22@@ -26,10 +27,13 @@
23 include libgearman/include.am
24 include libgearman-server/include.am
25 include tests/include.am
26+include unittests/include.am
27 include support/include.am
28
29 include docs/man_list
30
31+TESTS += ${check_PROGRAMS}
32+
33 EXTRA_DIST+= \
34 docs/Doxyfile.api \
35 docs/Doxyfile.dev \
36
37=== modified file 'configure.ac'
38--- configure.ac 2010-06-30 08:35:50 +0000
39+++ configure.ac 2010-06-30 19:08:26 +0000
40@@ -31,7 +31,7 @@
41 PANDORA_REQUIRE_LIBEVENT
42 PANDORA_REQUIRE_LIBUUID
43
44-
45+PANDORA_HAVE_LIBGTEST
46 PANDORA_HAVE_BETTER_MALLOC
47 PANDORA_HAVE_LIBSQLITE3
48 PANDORA_HAVE_LIBDRIZZLE
49
50=== modified file 'tests/include.am'
51--- tests/include.am 2010-06-30 02:10:27 +0000
52+++ tests/include.am 2010-06-30 19:08:26 +0000
53@@ -9,7 +9,6 @@
54 noinst_LTLIBRARIES+= tests/libtest.la
55 tests_libtest_la_SOURCES= tests/test.c tests/test_gearmand.c
56
57-
58 VALGRIND_COMMAND= $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes
59
60 TEST_LDADD= \
61@@ -17,6 +16,7 @@
62 libgearman/libgearman.la \
63 libgearman-server/libgearman-server.la
64
65+
66 if HAVE_LIBMEMCACHED
67 if HAVE_MEMCACHED
68 LIBMEMCACHED_PIDFILE = ${abs_top_builddir}/tests/Xumemc.pid
69
70=== added directory 'unittests'
71=== added file 'unittests/include.am'
72--- unittests/include.am 1970-01-01 00:00:00 +0000
73+++ unittests/include.am 2010-06-30 19:08:26 +0000
74@@ -0,0 +1,21 @@
75+# vim:ft=automake
76+# included from Top Level Makefile.am
77+# All paths should be given relative to the root
78+
79+
80+if HAVE_LIBGTEST
81+check_PROGRAMS += unittests/unittests
82+endif
83+
84+unittests_unittests_SOURCES= \
85+ unittests/main.cc
86+
87+unittests_unittests_CXXFLAGS= ${AM_CXXFLAGS} ${NO_WERROR}
88+unittests_unittests_LDADD= \
89+ libgearman/libgearman.la \
90+ libgearman-server/libgearman-server.la \
91+ ${LTLIBGTEST}
92+
93+# Shorthand
94+unit: check-TESTS
95+
96
97=== added file 'unittests/main.cc'
98--- unittests/main.cc 1970-01-01 00:00:00 +0000
99+++ unittests/main.cc 2010-06-30 19:08:26 +0000
100@@ -0,0 +1,21 @@
101+/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
102+ * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
103+ *
104+ * Copyright (C) 2010 Monty Taylor
105+ *
106+ * All rights reserved.
107+ *
108+ * Use and distribution licensed under the BSD license. See
109+ * the COPYING file in the parent directory for full text.
110+ */
111+
112+#include "config.h"
113+
114+#include <gtest/gtest.h>
115+
116+
117+int main(int argc, char **argv)
118+{
119+ ::testing::InitGoogleTest(&argc, argv);
120+ return RUN_ALL_TESTS();
121+}

Subscribers

People subscribed via source and target branches