test/harness/testcase.c
changeset 100 ad92d11d59b8
parent 93 9fb13a5dde3b
child 101 f44c530f80da
     1.1 --- a/test/harness/testcase.c	Mon Sep 23 21:18:27 2013 +0100
     1.2 +++ b/test/harness/testcase.c	Tue Oct 15 09:16:04 2013 +0100
     1.3 @@ -527,6 +527,31 @@
     1.4  }
     1.5  
     1.6  /*
     1.7 + * Run a testcase, returning FALSE on error.
     1.8 + * Bookloupe's output or a suitable error message will be shown.
     1.9 + */
    1.10 +gboolean testcase_show_output(Testcase *testcase)
    1.11 +{
    1.12 +    gboolean r;
    1.13 +    gchar *output;
    1.14 +    GError *error=NULL;
    1.15 +    r=testcase_create_input_files(testcase,&error);
    1.16 +    if (r)
    1.17 +    {
    1.18 +	r&=testcase_spawn_bookloupe(testcase,&output,&error);
    1.19 +	r&=testcase_remove_input_files(testcase,&error);
    1.20 +    }
    1.21 +    if (r)
    1.22 +	g_print("%s",output);
    1.23 +    else
    1.24 +    {
    1.25 +	g_print("%s\n",error->message);
    1.26 +	g_error_free(error);
    1.27 +    }
    1.28 +    return r;
    1.29 +}
    1.30 +
    1.31 +/*
    1.32   * Free a testcase warning.
    1.33   */
    1.34  void testcase_warning_free(TestcaseWarning *warning)