summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorTommi Virtanen <tv@hq.newdream.net>2011-01-07 13:15:40 -0800
committerTommi Virtanen <tv@hq.newdream.net>2011-01-10 15:19:45 -0800
commit9b0d5776967447d1f443cbd81de6155ad5d485a9 (patch)
treef3aecf5838f94c7d6af3266a612c3734a3f15da5 /Makefile.am
parent1a9ef3fae9180b382b6d2097bfc50670b6ccaf96 (diff)
downloadceph-9b0d5776967447d1f443cbd81de6155ad5d485a9.tar.gz
Use Google Test framework for unit tests.
Use ``make check`` to run the tests. The src/gtest directory comes from ``svn export http://googletest.googlecode.com/svn/tags/release-1.5.0 src/gtest`` and running "git add -f src/gtest". gtest is licensed under the New BSD license, see src/gtest/COPYING. For more on Google Test, see http://code.google.com/p/googletest/ Changed autogen.sh regenerate gtest automake files too. Make sure to run ``./autogen.sh && ./configure`` after merging this commit, or incremental builds may fail. The automake integration is inspired heavily by the protobuf project, and may still be problematic. Make git ignore files generated by gtest compilation. Currently putting in just one new-style unit test, refactoring old tests to fit will come in separate commits. Note: if you are starting daemons, listening on TCP ports, using multiple machines, mounting filesystems, etc, it's not a unit test and does not belong in this setup. A framework for system/integration tests will be provided later.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am18
1 files changed, 17 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 6ecb8ff4a0b..8879c60f4cc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,20 @@
AUTOMAKE_OPTIONS = gnu
EXTRA_DIST = autogen.sh ceph.spec.in
-SUBDIRS = src man
+# the "." here makes sure check-local builds gtest before it is used
+SUBDIRS = . src man
+
+# Build gtest before we build our own tests. Doing this instead of
+# SUBDIRS gtest's own tests being run and slowing us down.
+check-local:
+ @echo "Making lib/libgtest.a lib/libgtest_main.a in src/gtest"
+ @cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+
+# "make distclean" both runs this and recurses into src/gtest, if
+# gtest is in DIST_SUBDIRS. Take extra care to not fail when
+# effectively cleaned twice.
+clean-local:
+ @if test -e src/gtest/Makefile; then \
+ echo "Making clean in src/gtest"; \
+ cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ fi