[gtk+] Prepare the stylecontext test to run out-of-srcdir



commit f2ab9e497dc634ec10bfbb0b6d6fcfdfe2f20bc2
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 6 14:11:46 2010 -0500

    Prepare the stylecontext test to run out-of-srcdir
    
    This is necessary to make distcheck work.

 gtk/tests/Makefile.am    |    1 +
 gtk/tests/stylecontext.c |   16 +++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gtk/tests/Makefile.am b/gtk/tests/Makefile.am
index dda9727..186880b 100644
--- a/gtk/tests/Makefile.am
+++ b/gtk/tests/Makefile.am
@@ -6,6 +6,7 @@ INCLUDES = \
 	-I$(top_srcdir)/gdk		\
 	-DGDK_DISABLE_DEPRECATED	\
 	-DGTK_DISABLE_DEPRECATED	\
+	-DSRCDIR=\""$(abs_srcdir)"\"	\
 	$(GTK_DEBUG_FLAGS)		\
 	$(GTK_DEP_CFLAGS)
 
diff --git a/gtk/tests/stylecontext.c b/gtk/tests/stylecontext.c
index 20b7dad..54141ed 100644
--- a/gtk/tests/stylecontext.c
+++ b/gtk/tests/stylecontext.c
@@ -26,11 +26,11 @@ test_parse_at (void)
   gboolean res;
   gint i;
   const gchar *valid[] = {
-    "@import \"test.css\";",
-    "@import 'test.css';",
-    "@import url(\"test.css\");",
-    "@import url('test.css');",
-    "@import\nurl (\t\"test.css\" ) ;",
+    "@import \"" SRCDIR "/test.css\";",
+    "@import '" SRCDIR "/test.css';",
+    "@import url(\"" SRCDIR "/test.css\");",
+    "@import url('" SRCDIR "/test.css');",
+    "@import\nurl (\t\"" SRCDIR "/test.css\" ) ;",
     "@define-color bg_color #f9a039;",
     "@define-color color @bg_color;",
     "@define-color color rgb(100, 99, 88);",
@@ -48,8 +48,8 @@ test_parse_at (void)
   };
 
   const gchar *invalid[] = {
-    "@import test.css ;",
-    "@import url ( \"test.css\" xyz );",
+    "@import " SRCDIR "/test.css ;",
+    "@import url ( \"" SRCDIR "/test.css\" xyz );",
     "@import url(\");",
     "@import url(');",
     "@import url(\"abc');",
@@ -77,6 +77,8 @@ test_parse_at (void)
     {
       provider = gtk_css_provider_new ();
       res = gtk_css_provider_load_from_data (provider, valid[i], -1, &error);
+      if (error)
+        g_print ("parsing '%s': got unexpected error: %s\n", valid[i], error->message);
       g_assert_no_error (error);
       g_assert (res);
 



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