summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2007-11-10 23:59:05 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-11-10 23:59:05 +0000
commit4e8a4021a680c88730de1d13229db816cc86a354 (patch)
tree7a4ba91b546fb90937c6edb4537a87ce4a083518 /tests
parent464ae984952cca6afe954cf3bb89e17a40fc58e6 (diff)
downloadgtk+-4e8a4021a680c88730de1d13229db816cc86a354.tar.gz
Parse a file given on the cmdline
svn path=/trunk/; revision=18981
Diffstat (limited to 'tests')
-rw-r--r--tests/buildertest.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/buildertest.c b/tests/buildertest.c
index 079e12d281..ad4d1fed9d 100644
--- a/tests/buildertest.c
+++ b/tests/buildertest.c
@@ -1760,11 +1760,36 @@ test_reference_counting (void)
return TRUE;
}
+static void
+test_file (const gchar *filename)
+{
+ GtkBuilder *builder;
+ GError *error = NULL;
+
+ builder = gtk_builder_new ();
+
+ if (!gtk_builder_add_from_file (builder, filename, &error))
+ {
+ g_print ("%s\n", error->message);
+ g_error_free (error);
+ }
+
+ g_object_unref (builder);
+ builder = NULL;
+}
+
int
main (int argc, char **argv)
{
gtk_init (&argc, &argv);
+ if (argc > 1)
+ {
+ test_file (argv[1]);
+
+ return 0;
+ }
+
g_print ("Testing parser\n");
if (!test_parser ())
g_error ("test_parser failed");