test/harness/testcase.h
author ali <ali@juiblex.co.uk>
Wed Oct 16 22:51:29 2013 +0100 (2013-10-16)
changeset 104 70cc629ec1e0
parent 101 f44c530f80da
permissions -rw-r--r--
Fix bug #28: Don't report ., as double punctuation after "etc" or "&c"
     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     GSList *outputs;
    45     char *expected;
    46     TestcaseSummary summary;
    47     GSList *warnings;
    48     char *encoding;	/* The character encoding to talk to BOOKLOUPE in */
    49     char **options;
    50     char *test_output;
    51     enum {
    52 	TESTCASE_XFAIL=1<<0,
    53 	TESTCASE_TMP_DIR=1<<1,
    54 	TESTCASE_UNIX_NEWLINES=1<<2,
    55 	TESTCASE_OS9_NEWLINES=1<<3,
    56     } flags;
    57 } Testcase;
    58 
    59 GQuark testcase_error_quark(void);
    60 gboolean testcase_run(Testcase *testcase);
    61 gboolean testcase_show_output(Testcase *testcase);
    62 void testcase_free(Testcase *testcase);
    63 
    64 #endif	/* TESTCASE_H */