author | ali <ali@juiblex.co.uk> |
Sun Oct 27 17:01:47 2013 +0000 (2013-10-27) | |
changeset 103 | d22d8cd4f628 |
parent 101 | f44c530f80da |
permissions | -rw-r--r-- |
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@102 | 44 |
GSList *outputs; |
ali@0 | 45 |
char *expected; |
ali@101 | 46 |
TestcaseSummary summary; |
ali@17 | 47 |
GSList *warnings; |
ali@7 | 48 |
char *encoding; /* The character encoding to talk to BOOKLOUPE in */ |
ali@9 | 49 |
char **options; |
ali@102 | 50 |
char *test_output; |
ali@0 | 51 |
enum { |
ali@0 | 52 |
TESTCASE_XFAIL=1<<0, |
ali@9 | 53 |
TESTCASE_TMP_DIR=1<<1, |
ali@101 | 54 |
TESTCASE_UNIX_NEWLINES=1<<2, |
ali@101 | 55 |
TESTCASE_OS9_NEWLINES=1<<3, |
ali@0 | 56 |
} flags; |
ali@0 | 57 |
} Testcase; |
ali@0 | 58 |
|
ali@7 | 59 |
GQuark testcase_error_quark(void); |
ali@6 | 60 |
gboolean testcase_run(Testcase *testcase); |
ali@96 | 61 |
gboolean testcase_show_output(Testcase *testcase); |
ali@0 | 62 |
void testcase_free(Testcase *testcase); |
ali@0 | 63 |
|
ali@0 | 64 |
#endif /* TESTCASE_H */ |