test/harness/testcase.h
author ali <ali@juiblex.co.uk>
Fri Oct 25 11:15:18 2013 +0100 (2013-10-25)
changeset 102 ff0aa9b1397a
parent 101 f44c530f80da
permissions -rw-r--r--
Fix bug #14: Add a configuration file
     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 */