[couchdb-glib/wip/query-response] build tests for CouchdbSession and CouchdbDatabase



commit e23dd58d4f8939c8cafab4665866875ce0183560
Author: Krzysztof Klimonda <kklimonda syntaxhighlighted com>
Date:   Wed Jan 19 13:51:26 2011 +0100

    build tests for CouchdbSession and CouchdbDatabase

 tests/Makefile.am |   56 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 23 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bb91a1d..36dd759 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -8,18 +8,21 @@ INCLUDES =				\
 	-I$(top_srcdir)/couchdb-glib	\
 	-I$(top_srcdir)/desktopcouch-glib
 
-test_list_databases_SOURCES = test-list-databases.c
-test_list_databases_LDADD = 	\
+test_couchdb_glib_SOURCES = test-couchdb-glib.c
+test_couchdb_glib_LDADD = 	\
 	$(COUCHDB_GLIB_LIBS)	\
 	$(OAUTH_LIBS)		\
 	-luuid			\
 	$(top_builddir)/couchdb-glib/libcouchdb-glib-1.0.la
 
-test_couchdb_glib_SOURCES = test-couchdb-glib.c
-test_couchdb_glib_LDADD = 	\
+test_couchdb_session_SOURCES = test-couchdb-session.c
+test_couchdb_session_LDADD = 	\
+	$(COUCHDB_GLIB_LIBS)	\
+	$(top_builddir)/couchdb-glib/libcouchdb-glib-1.0.la
+
+test_couchdb_database_SOURCES = test-couchdb-database.c
+test_couchdb_database_LDADD = 	\
 	$(COUCHDB_GLIB_LIBS)	\
-	$(OAUTH_LIBS)		\
-	-luuid			\
 	$(top_builddir)/couchdb-glib/libcouchdb-glib-1.0.la
 
 test_desktopcouch_glib_SOURCES = test-desktopcouch-glib.c
@@ -41,6 +44,8 @@ test_oauth_LDADD = 	\
 EXTRA_DIST = createCouchContacts.py test-oauth.py
 
 check_PROGRAMS = \
+	test-couchdb-session \
+	test-couchdb-database \
 	test-couchdb-glib \
 	test-desktopcouch-glib \
 	$(NULL)
@@ -58,27 +63,32 @@ COUCHDB_CONFIG_AUTH = $(top_srcdir)/tests/config/couchdb-auth.ini
 REPORT_XML = $(top_srcdir)/tests/report.xml
 REPORT_HTML = $(top_srcdir)/tests/report.html
 
-stop-couchdb:
+stop-couchdb: stamp-couchdb-stopped
+stamp-couchdb-stopped:
 	@/usr/bin/couchdb -p $(COUCHDB_PID) -d
 	@/bin/rm -f $(COUCHDB_PID)
+	test -f stamp-couchdb-running && /bin/rm stamp-couchdb-running || true
+	touch $@
 
-list:
-	@/usr/bin/gtester -q -l -p="$(TESTPATH)" $(check_PROGRAMS)
-
-test: $(check_PROGRAMS)
+start-couchdb: stop-couchdb stamp-couchdb-running
+stamp-couchdb-running:
 	@echo "Setting up the couchdb server..."
-	@/usr/bin/couchdb -p $(COUCHDB_PID) -d > /dev/null
+	@/usr/bin/couchdb -p $(COUCHDB_PID) -d
 	@/bin/rm -rf $(COUCHDB_VAR)
 	@/bin/mkdir -p $(COUCHDB_VAR)
 	@/usr/bin/couchdb -n -a /etc/couchdb/default.ini \
-	    -o $(COUCHDB_STDOUT) -e $(COUCHDB_STDERR) \
-	    -a $(COUCHDB_CONFIG_AUTH) -p $(COUCHDB_PID) -b > /dev/null
-	@/bin/sleep 1
-	-@/usr/bin/gtester -q -k -o $(REPORT_XML) -p="$(TESTPATH)" \
-	    $(check_PROGRAMS) > /dev/null
-	-@/usr/bin/gtester-report $(REPORT_XML) > $(REPORT_HTML)
-	@keep_couchdb="$(KEEP_COUCHDB)x"; \
-    if test $$keep_couchdb == "x"; then \
-	    echo "Tearing down the couchdb server..."; \
-	    /usr/bin/couchdb -p $(COUCHDB_PID) -d > /dev/null; \
-	fi
+		-o $(COUCHDB_STDOUT) -e $(COUCHDB_STDERR) \
+		-a $(COUCHDB_CONFIG_AUTH) -p $(COUCHDB_PID) -b > /dev/null
+	test -f stamp-couchdb-stopped && /bin/rm stamp-couchdb-stopped || true
+	touch $@
+
+list:
+	@/usr/bin/gtester -q -l -p="$(TESTPATH)" $(check_PROGRAMS)
+
+test: $(check_PROGRAMS) start-couchdb
+	@/bin/sleep 2
+	-@/usr/bin/gtester --verbose -k -o $(REPORT_XML) -p="$(TESTPATH)" \
+	$(check_PROGRAMS)
+	@keep_couchdb="$(KEEP_COUCHDB)x";
+	make stop-couchdb
+



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]