test/harness/testcase.h
author ali <ali@juiblex.co.uk>
Mon Feb 20 08:13:47 2012 +0000 (2012-02-20)
changeset 35 51a0beae92f6
parent 9 6a13fe0fc19e
child 96 8c2d6a0cf717
permissions -rw-r--r--
Add testcase for embedded CRs
     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 void testcase_free(Testcase *testcase);
    53 
    54 #endif	/* TESTCASE_H */