test/harness/testcase.h
author ali <ali@juiblex.co.uk>
Sat Oct 26 18:47:33 2013 +0100 (2013-10-26)
changeset 101 f44c530f80da
parent 96 8c2d6a0cf717
child 102 ff0aa9b1397a
permissions -rw-r--r--
Fix bug #24: Accept alternate form of newline
     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     GSList *texts;
    19 } TestcaseSummary;
    20 
    21 typedef struct {
    22     /*
    23      * Does this warning relate to a real problem in the etext
    24      * (eg., error and false-negative).
    25      */
    26     gboolean is_real;
    27     /*
    28      * Do we "expect" BOOKLOUPE to get this wrong
    29      * (eg., false-negative and false-positive)
    30      */
    31     gboolean xfail;
    32     /*
    33      * For real problems, the first location should be the
    34      * actual location of the problem.
    35      */
    36     GSList *locations;
    37     char *text;
    38 } TestcaseWarning;
    39 
    40 typedef struct {
    41     char *basename;
    42     char *tmpdir;
    43     GSList *inputs;
    44     char *expected;
    45     TestcaseSummary summary;
    46     GSList *warnings;
    47     char *encoding;	/* The character encoding to talk to BOOKLOUPE in */
    48     char **options;
    49     enum {
    50 	TESTCASE_XFAIL=1<<0,
    51 	TESTCASE_TMP_DIR=1<<1,
    52 	TESTCASE_UNIX_NEWLINES=1<<2,
    53 	TESTCASE_OS9_NEWLINES=1<<3,
    54     } flags;
    55 } Testcase;
    56 
    57 GQuark testcase_error_quark(void);
    58 gboolean testcase_run(Testcase *testcase);
    59 gboolean testcase_show_output(Testcase *testcase);
    60 void testcase_free(Testcase *testcase);
    61 
    62 #endif	/* TESTCASE_H */