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-- |
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 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;
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);
64 #endif /* TESTCASE_H */