| author | ali <ali@juiblex.co.uk> |
| Sun Oct 20 21:06:25 2013 +0100 (2013-10-20) | |
| changeset 184 | cd3068704d3a |
| parent 108 | 853e8a9ccfc9 |
| child 191 | 189183b37598 |
| permissions | -rw-r--r-- |
1 #ifndef TESTCASE_H
2 #define TESTCASE_H
4 #include <glib.h>
6 #define TESTCASE_ERROR testcase_error_quark()
8 typedef enum {
9 TESTCASE_ERROR_FAILED
10 } TestcaseError;
12 typedef struct {
13 guint line;
14 guint column; /* or 0 for unspecified */
15 } TestcaseLocation;
17 typedef struct {
18 GSList *texts;
19 } TestcaseSummary;
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;
40 typedef struct {
41 char *basename;
42 char *tmpdir;
43 GSList *inputs;
44 char *expected;
45 TestcaseSummary summary;
46 GSList *warnings;
47 char *encoding; /* The character encoding to talk to BOOKLOUPE in */
48 char **options;
49 enum {
50 TESTCASE_XFAIL=1<<0,
51 TESTCASE_TMP_DIR=1<<1,
52 TESTCASE_UNIX_NEWLINES=1<<2,
53 } flags;
54 } Testcase;
56 GQuark testcase_error_quark(void);
57 gboolean testcase_run(Testcase *testcase);
58 gboolean testcase_show_output(Testcase *testcase);
59 void testcase_free(Testcase *testcase);
61 #endif /* TESTCASE_H */