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
ali@0
     1
#ifndef TESTCASE_H
ali@0
     2
#define TESTCASE_H
ali@0
     3
ali@6
     4
#include <glib.h>
ali@6
     5
ali@7
     6
#define TESTCASE_ERROR testcase_error_quark()
ali@7
     7
ali@7
     8
typedef enum {
ali@7
     9
    TESTCASE_ERROR_FAILED
ali@7
    10
} TestcaseError;
ali@7
    11
ali@0
    12
typedef struct {
ali@17
    13
    guint line;
ali@17
    14
    guint column;		/* or 0 for unspecified */
ali@17
    15
} TestcaseLocation;
ali@17
    16
ali@17
    17
typedef struct {
ali@101
    18
    GSList *texts;
ali@101
    19
} TestcaseSummary;
ali@101
    20
ali@101
    21
typedef struct {
ali@17
    22
    /*
ali@17
    23
     * Does this warning relate to a real problem in the etext
ali@17
    24
     * (eg., error and false-negative).
ali@17
    25
     */
ali@17
    26
    gboolean is_real;
ali@17
    27
    /*
ali@17
    28
     * Do we "expect" BOOKLOUPE to get this wrong
ali@17
    29
     * (eg., false-negative and false-positive)
ali@17
    30
     */
ali@17
    31
    gboolean xfail;
ali@17
    32
    /*
ali@17
    33
     * For real problems, the first location should be the
ali@17
    34
     * actual location of the problem.
ali@17
    35
     */
ali@17
    36
    GSList *locations;
ali@17
    37
    char *text;
ali@17
    38
} TestcaseWarning;
ali@17
    39
ali@17
    40
typedef struct {
ali@0
    41
    char *basename;
ali@9
    42
    char *tmpdir;
ali@9
    43
    GSList *inputs;
ali@0
    44
    char *expected;
ali@101
    45
    TestcaseSummary summary;
ali@17
    46
    GSList *warnings;
ali@7
    47
    char *encoding;	/* The character encoding to talk to BOOKLOUPE in */
ali@9
    48
    char **options;
ali@0
    49
    enum {
ali@0
    50
	TESTCASE_XFAIL=1<<0,
ali@9
    51
	TESTCASE_TMP_DIR=1<<1,
ali@101
    52
	TESTCASE_UNIX_NEWLINES=1<<2,
ali@101
    53
	TESTCASE_OS9_NEWLINES=1<<3,
ali@0
    54
    } flags;
ali@0
    55
} Testcase;
ali@0
    56
ali@7
    57
GQuark testcase_error_quark(void);
ali@6
    58
gboolean testcase_run(Testcase *testcase);
ali@96
    59
gboolean testcase_show_output(Testcase *testcase);
ali@0
    60
void testcase_free(Testcase *testcase);
ali@0
    61
ali@0
    62
#endif	/* TESTCASE_H */