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