diff options
author | Matthias Clasen <mclasen@redhat.com> | 2013-05-31 18:02:03 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-05-31 18:03:53 -0400 |
commit | e17b595e3bacfb7333bab6fcd1c62d05e7228936 (patch) | |
tree | 53137441a64f82e316138ab44bc847cecb0d0c76 /tests/testboundaries.c | |
parent | 6c16dfe8ad012a2551d0270a0325574e9ce3cef7 (diff) | |
download | pango-e17b595e3bacfb7333bab6fcd1c62d05e7228936.tar.gz |
Make tests installable
This ensures that tests are run continuously on ostree.gnome.org.
Diffstat (limited to 'tests/testboundaries.c')
-rw-r--r-- | tests/testboundaries.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/tests/testboundaries.c b/tests/testboundaries.c index 6f860bac..241e6859 100644 --- a/tests/testboundaries.c +++ b/tests/testboundaries.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <unistd.h> +#include <glib.h> #include <pango/pango.h> #define CHFORMAT "%0#6x" @@ -311,20 +312,13 @@ check_invariants (const char *text) g_free (attrs); } -int -main (int argc, char *argv[]) +static void +test_boundaries (void) { gchar *text; - const gchar *srcdir; const gchar *filename; - - g_setenv ("PANGO_RC_FILE", "./pangorc", TRUE); - - srcdir = getenv ("srcdir"); - if (!srcdir) - srcdir = "."; - - filename = g_strdup_printf ("%s/boundaries.utf8", srcdir); + filename = g_test_get_filename (G_TEST_DIST, "boundaries.utf8", NULL); + g_print ("sample file: %s\n", filename); if (!g_file_get_contents (filename, &text, NULL, NULL)) fail ("Couldn't open sample text file"); @@ -334,7 +328,15 @@ main (int argc, char *argv[]) g_free (text); printf ("testboundaries passed\n"); +} + +int +main (int argc, char *argv[]) +{ + g_test_init (&argc, &argv, NULL); + + g_test_add_func ("/text/boundaries", test_boundaries); - return 0; + return g_test_run (); } |