[tracker] distcheck: fix all conceivable misassumptions on srcdir and builddir.



commit a9db0d7f35e05fe25d39fc56294fdfbfc92a2fb7
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Mar 25 16:26:56 2010 +0100

    distcheck: fix all conceivable misassumptions on srcdir and builddir.

 tests/libtracker-data/Makefile.am             |   22 +++++++++++++++++++---
 tests/libtracker-data/tracker-ontology-test.c |   18 ++++++++++++------
 2 files changed, 31 insertions(+), 9 deletions(-)
---
diff --git a/tests/libtracker-data/Makefile.am b/tests/libtracker-data/Makefile.am
index c513471..524b00b 100644
--- a/tests/libtracker-data/Makefile.am
+++ b/tests/libtracker-data/Makefile.am
@@ -31,8 +31,8 @@ TEST_PROGS += 								\
 
 INCLUDES = 								\
 	-DTRACKER_COMPILATION						\
-	-DTOP_SRCDIR=\"$(top_srcdir)\"					\
-	-DTOP_BUILDDIR=\"$(top_builddir)\"				\
+	-DTOP_SRCDIR=\"$(abs_top_srcdir)\"				\
+	-DTOP_BUILDDIR=\"$(abs_top_builddir)\"				\
 	-DG_LOG_DOMAIN=\"Tracker\"					\
 	-I$(top_srcdir)/src						\
 	-I$(top_srcdir)/tests/common					\
@@ -74,4 +74,20 @@ tracker_backup_SOURCES = 						\
 
 tracker_backup_LDADD = $(common_ldadd)
 
-EXTRA_DIST = dawg-testcases
+EXTRA_DIST = \
+	dawg-testcases				\
+	change/source/99-example.ontology.v1	\
+	change/source/99-example.ontology.v2	\
+	change/source/99-example.ontology.v3	\
+	change/source/99-example.ontology.v4	\
+	change/test-1.out			\
+	change/test-1.rq			\
+	change/test-2.out			\
+	change/test-2.rq			\
+	change/test-3.out			\
+	change/test-3.rq			\
+	change/updates/99-example.queries.v2	\
+	change/updates/99-example.queries.v3	\
+	change/updates/99-example.queries.v4	\
+	ontologies/20-dc.ontology		\
+	ontologies/31-nao.ontology
diff --git a/tests/libtracker-data/tracker-ontology-test.c b/tests/libtracker-data/tracker-ontology-test.c
index b6d7891..0d54eec 100644
--- a/tests/libtracker-data/tracker-ontology-test.c
+++ b/tests/libtracker-data/tracker-ontology-test.c
@@ -218,7 +218,7 @@ test_ontology_change (void)
 {
 	gchar *ontology_file;
 	GFile *file2;
-	gchar *prefix;
+	gchar *prefix, *build_prefix;
 	gchar *ontology_dir;
 	guint i;
 	GError *error = NULL;
@@ -227,19 +227,20 @@ test_ontology_change (void)
 	delete_db (TRUE);
 
 	prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
+	build_prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_BUILDDIR, "tests", "libtracker-data", NULL);
 
 	test_schemas[0] = g_build_path (G_DIR_SEPARATOR_S, prefix, "ontologies", "20-dc", NULL);
 	test_schemas[1] = g_build_path (G_DIR_SEPARATOR_S, prefix, "ontologies", "31-nao", NULL);
-	test_schemas[2] = g_build_path (G_DIR_SEPARATOR_S, prefix, "change", "ontologies", "99-example", NULL);
+	test_schemas[2] = g_build_path (G_DIR_SEPARATOR_S, build_prefix, "change", "ontologies", "99-example", NULL);
 
-	ontology_file = g_build_path (G_DIR_SEPARATOR_S, prefix, "change", "ontologies", "99-example.ontology", NULL);
+	ontology_file = g_build_path (G_DIR_SEPARATOR_S, build_prefix, "change", "ontologies", "99-example.ontology", NULL);
 
 	file2 = g_file_new_for_path (ontology_file);
 
 	g_file_delete (file2, NULL, NULL);
 
-	ontology_dir = g_build_path (G_DIR_SEPARATOR_S, prefix, "change", "ontologies", NULL);
-	g_mkdir (ontology_dir, 0777);
+	ontology_dir = g_build_path (G_DIR_SEPARATOR_S, build_prefix, "change", "ontologies", NULL);
+	g_mkdir_with_parents (ontology_dir, 0777);
 	g_free (ontology_dir);
 
 	for (i = 0; changes[i].ontology; i++) {
@@ -257,7 +258,10 @@ test_ontology_change (void)
 		g_free (from);
 		g_free (to);
 
-		g_file_copy (file1, file2, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, NULL);
+		g_file_copy (file1, file2, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error);
+                g_assert_no_error (error);
+
+                g_chmod (ontology_file, 0666);
 
 		tracker_data_manager_init (0, (const gchar **) test_schemas,
 		                           NULL, FALSE);
@@ -310,6 +314,7 @@ test_ontology_change (void)
 	g_free (test_schemas[0]);
 	g_free (test_schemas[1]);
 	g_free (test_schemas[2]);
+        g_free (build_prefix);
 	g_free (prefix);
 }
 
@@ -347,6 +352,7 @@ test_query (gconstpointer test_data)
 	test_info = test_data;
 
 	prefix = g_build_path (G_DIR_SEPARATOR_S, TOP_SRCDIR, "tests", "libtracker-data", NULL);
+
 	data_prefix = g_build_filename (prefix, test_info->data, NULL);
 	test_prefix = g_build_filename (prefix, test_info->test_name, NULL);
 	g_free (prefix);



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