diff -r 4a80c6053a66 -r ad92d11d59b8 test/harness/loupe-test.c --- a/test/harness/loupe-test.c Mon Jan 30 23:32:47 2012 +0000 +++ b/test/harness/loupe-test.c Tue Oct 15 09:16:04 2013 +0100 @@ -6,6 +6,14 @@ #include "testcase.h" #include "testcaseio.h" +static gboolean show_output; + +static GOptionEntry options[]={ + { "show-output", 'o', 0, G_OPTION_ARG_NONE, &show_output, + "Show bookloupe output", NULL }, + { NULL } +}; + /* * Returns FALSE if the test should be considered to have failed. * (returns TRUE on pass or expected-fail). @@ -17,7 +25,10 @@ testcase=testcase_parse_file(filename); if (!testcase) return FALSE; - retval=testcase_run(testcase); + if (show_output) + retval=testcase_show_output(testcase); + else + retval=testcase_run(testcase); testcase_free(testcase); return retval; } @@ -26,6 +37,16 @@ { int i; gboolean pass=TRUE; + GError *err=NULL; + GOptionContext *context; + context=g_option_context_new("file - run a bookloupe testcase"); + g_option_context_add_main_entries(context,options,NULL); + if (!g_option_context_parse(context,&argc,&argv,&err)) + { + g_printerr("loupe-test: %s\n",err->message); + g_printerr("Use \"%s --help\" for help\n",argv[0]); + exit(1); + } bl_set_print_handlers(); for(i=1;i