diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2007-11-10 23:59:05 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-11-10 23:59:05 +0000 |
commit | 4e8a4021a680c88730de1d13229db816cc86a354 (patch) | |
tree | 7a4ba91b546fb90937c6edb4537a87ce4a083518 /tests | |
parent | 464ae984952cca6afe954cf3bb89e17a40fc58e6 (diff) | |
download | gtk+-4e8a4021a680c88730de1d13229db816cc86a354.tar.gz |
Parse a file given on the cmdline
svn path=/trunk/; revision=18981
Diffstat (limited to 'tests')
-rw-r--r-- | tests/buildertest.c | 25 |
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"); |