[tracker/rss-enclosures] functional-tests: Add direct-query-test and default-update-test



commit 35ddbb51028e61e27d2ea0c571d62df768a70a68
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Jul 7 15:56:45 2010 +0200

    functional-tests: Add direct-query-test and default-update-test

 tests/functional-tests/.gitignore               |    4 ++
 tests/functional-tests/Makefile.am              |   41 +++++++++++++++++++++-
 tests/functional-tests/default-update-test.vala |   14 ++++++++
 tests/functional-tests/direct-query-test.vala   |   17 +++++++++
 4 files changed, 74 insertions(+), 2 deletions(-)
---
diff --git a/tests/functional-tests/.gitignore b/tests/functional-tests/.gitignore
index 7eb76a3..ea6303e 100644
--- a/tests/functional-tests/.gitignore
+++ b/tests/functional-tests/.gitignore
@@ -2,8 +2,12 @@ shared-query-test.c
 shared-update-test.c
 bus-query-test
 bus-query-test.c
+direct-query-test
+direct-query-test.c
 bus-update-test
 bus-update-test.c
+default-update-test
+default-update-test.c
 ttl
 force-sqlite-misused-batch.sh
 force-sqlite-misused.sh
diff --git a/tests/functional-tests/Makefile.am b/tests/functional-tests/Makefile.am
index a454c3b..8065112 100644
--- a/tests/functional-tests/Makefile.am
+++ b/tests/functional-tests/Makefile.am
@@ -7,6 +7,7 @@ INCLUDES =					\
 	-I$(top_srcdir)/src/libtracker-direct	\
 	-I$(top_srcdir)/src/libtracker-bus	\
 	-I$(top_builddir)/src/libtracker-sparql	\
+	-I$(top_builddir)/src/libtracker-direct	\
 	-I$(top_builddir)/src/libtracker-bus	\
 	$(WARN_CFLAGS)				\
 	$(DBUS_CFLAGS)				\
@@ -52,7 +53,7 @@ bashscripts_SCRIPTS = 				\
 	@sed -e "s|@topsrcdir[ ]|${top_srcdir}|" \
 	     -e "s|@libexecdir[ ]|${libexecdir}|" $< > $@
 
-noinst_PROGRAMS = busy-handling-test bus-query-test bus-update-test
+noinst_PROGRAMS = busy-handling-test direct-query-test bus-query-test default-update-test bus-update-test
 
 busy_handling_test_VALASOURCES = busy-handling-test.vala
 
@@ -69,6 +70,18 @@ busy_handling_test_LDADD = \
 	$(GLIB2_LIBS) \
 	$(DBUS_LIBS)
 
+direct_query_test_VALASOURCES = shared-query-test.vala direct-query-test.vala
+
+direct_query_test_SOURCES = \
+	direct-query-test.vala.stamp \
+	$(direct_query_test_VALASOURCES:.vala=.c)
+
+default_update_test_VALASOURCES = shared-update-test.vala default-update-test.vala
+
+default_update_test_SOURCES = \
+	default-update-test.vala.stamp \
+	$(default_update_test_VALASOURCES:.vala=.c)
+
 bus_query_test_VALASOURCES = shared-query-test.vala bus-query-test.vala
 
 bus_query_test_SOURCES = \
@@ -81,6 +94,26 @@ bus_update_test_SOURCES = \
 	bus-update-test.vala.stamp \
 	$(bus_update_test_VALASOURCES:.vala=.c)
 
+direct_vapi_sources = \
+	$(top_srcdir)/src/libtracker-sparql/tracker-sparql-$(TRACKER_API_VERSION).vapi \
+	$(top_srcdir)/src/libtracker-direct/tracker-direct-$(TRACKER_API_VERSION).vapi
+
+direct-query-test.vala.stamp: $(direct_query_test_VALASOURCES) $(direct_vapi_sources)
+	$(AM_V_GEN)$(VALAC) $(GCOV_VALAFLAGS) -C $(VALAFLAGS) --pkg gio-2.0 $^
+	$(AM_V_GEN)touch $@
+
+direct_query_test_LDADD = \
+	$(top_builddir)/src/libtracker-direct/libtracker-direct.la \
+	$(top_builddir)/src/libtracker-sparql/libtracker-sparql-$(TRACKER_API_VERSION).la \
+	$(GIO_LIBS) \
+	$(GLIB2_LIBS)
+
+default-update-test.vala.stamp: $(default_update_test_VALASOURCES) $(direct_vapi_sources)
+	$(AM_V_GEN)$(VALAC) $(GCOV_VALAFLAGS) -C $(VALAFLAGS) --pkg gio-2.0 $^
+	$(AM_V_GEN)touch $@
+
+default_update_test_LDADD = $(direct_query_test_LDADD)
+
 bus_vapi_sources = \
 	$(top_builddir)/src/libtracker-sparql/tracker-sparql-$(TRACKER_API_VERSION).vapi \
 	$(top_builddir)/src/libtracker-bus/tracker-bus-$(TRACKER_API_VERSION).vapi
@@ -105,7 +138,9 @@ bus_update_test_LDADD = $(bus_query_test_LDADD)
 
 BUILT_SOURCES = 				\
 	busy-handling-test.vala.stamp 		\
+	direct-query-test.vala.stamp 		\
 	bus-query-test.vala.stamp 		\
+	default-update-test.vala.stamp 		\
 	bus-update-test.vala.stamp
 
 
@@ -126,5 +161,7 @@ MAINTAINERCLEANFILES =					\
 	$(BUILT_SOURCES)				\
 	$(busy_handling_test_VALASOURCES:.vala=.c)	\
 	$(bus_query_test_VALASOURCES:.vala=.c)		\
-	$(bus_update_test_VALASOURCES:.vala=.c)
+	$(bus_update_test_VALASOURCES:.vala=.c)		\
+	$(direct_query_test_VALASOURCES:.vala=.c)	\
+	$(default_update_test_VALASOURCES:.vala=.c)
 
diff --git a/tests/functional-tests/default-update-test.vala b/tests/functional-tests/default-update-test.vala
new file mode 100644
index 0000000..59ec0e8
--- /dev/null
+++ b/tests/functional-tests/default-update-test.vala
@@ -0,0 +1,14 @@
+int
+main( string[] args )
+{
+	int res = -1;
+
+	try {
+		TestApp app = new TestApp (Tracker.Sparql.Connection.get());
+		res = app.run();
+	} catch (Tracker.Sparql.Error e) {
+		warning ("Couldn't perform test: %s", e.message);
+	}
+
+	return res;
+}
diff --git a/tests/functional-tests/direct-query-test.vala b/tests/functional-tests/direct-query-test.vala
new file mode 100644
index 0000000..27ea709
--- /dev/null
+++ b/tests/functional-tests/direct-query-test.vala
@@ -0,0 +1,17 @@
+using Tracker;
+using Tracker.Sparql;
+
+int
+main( string[] args )
+{
+	int res = -1;
+
+	try {
+		TestApp app = new TestApp (new Tracker.Direct.Connection ());
+		res = app.run ();
+	} catch (Sparql.Error e) {
+		warning ("Couldn't perform test: %s", e.message);
+	}
+
+	return res;
+}



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