test/harness/testcase.h
author ali <ali@juiblex.co.uk>
Tue Sep 24 07:18:50 2013 +0100 (2013-09-24)
changeset 96 8c2d6a0cf717
parent 17 2c88fd553e5d
child 101 f44c530f80da
permissions -rw-r--r--
Fix bug #10: loupe-test should have an option to display bookloupe output
     1 #ifndef TESTCASE_H
     2 #define TESTCASE_H
     3 
     4 #include <glib.h>
     5 
     6 #define TESTCASE_ERROR testcase_error_quark()
     7 
     8 typedef enum {
     9     TESTCASE_ERROR_FAILED
    10 } TestcaseError;
    11 
    12 typedef struct {
    13     guint line;
    14     guint column;		/* or 0 for unspecified */
    15 } TestcaseLocation;
    16 
    17 typedef struct {
    18     /*
    19      * Does this warning relate to a real problem in the etext
    20      * (eg., error and false-negative).
    21      */
    22     gboolean is_real;
    23     /*
    24      * Do we "expect" BOOKLOUPE to get this wrong
    25      * (eg., false-negative and false-positive)
    26      */
    27     gboolean xfail;
    28     /*
    29      * For real problems, the first location should be the
    30      * actual location of the problem.
    31      */
    32     GSList *locations;
    33     char *text;
    34 } TestcaseWarning;
    35 
    36 typedef struct {
    37     char *basename;
    38     char *tmpdir;
    39     GSList *inputs;
    40     char *expected;
    41     GSList *warnings;
    42     char *encoding;	/* The character encoding to talk to BOOKLOUPE in */
    43     char **options;
    44     enum {
    45 	TESTCASE_XFAIL=1<<0,
    46 	TESTCASE_TMP_DIR=1<<1,
    47     } flags;
    48 } Testcase;
    49 
    50 GQuark testcase_error_quark(void);
    51 gboolean testcase_run(Testcase *testcase);
    52 gboolean testcase_show_output(Testcase *testcase);
    53 void testcase_free(Testcase *testcase);
    54 
    55 #endif	/* TESTCASE_H */