1 gutcheck test framework
2 =======================
4 Running existing testcases
5 --------------------------
7 The test harness (the program that runs a test) is called gc-test. The various
8 testcases are stored in multiple text files, typically with a .tst extension.
10 To run a testcase when all of gutcheck, gc-test and the testcase file are
11 in the current directory simply do something like:
13 % gc-test missing-space.tst
15 from a command prompt. Under MS-Windows, this is called a command window and
16 the prompt will normally look slightly different, eg.,
18 C:\DP> gc-test missing-space.tst
20 To run all the tests in the current directory, do something like this:
24 If gutcheck is not in the current directory, then you can set an environment
25 variable (GUTCHECK) to point at it. For example, on MS-Windows you might do:
27 C:\DP> set GUTCHECK=C:\GUTCHECK\GUTCHECK.EXE
30 Writing your own testcases
31 --------------------------
33 Writing a new testcase is pretty painless. Most testcases follow this simple
36 ┌──────────────────────────────────────────┐
37 │**************** INPUT **************** │
38 │"Look!John, over there!" │
39 │**************** EXPECTED ****************│
41 │"Look!John, over there!" │
42 │ Line 1 column 6 - Missing space? │
43 └──────────────────────────────────────────┘
45 The sixteen asterisks in this example form what is known as the "flag". This
46 flag must come before and after all tags (eg., INPUT and EXPECTED). In the
47 unlikely event that you need sixteen asterisks at the start of line of text,
48 then simply choose a different flag and use it throughout the file (flags
49 can be any sequence of ASCII characters except control codes and space).
51 Note that the header that gutcheck normally outputs is not included in the
52 expected output. This avoids problems with not knowing beforehand the name
53 of the file that gutcheck will be asked to look at (and saves typing!).
54 gutcheck prints a blank line before each warning. These are not part of the
55 header and so do need to be included.
57 To test that gutcheck produces no output, you still need to include
58 an EXPECTED tag, just with no text following it. If there is no EXPECTED
59 tag, then gc-test will consider that no expectation exists and won't check
62 There is no support yet for non-ASCII testcases, embedded linefeeds,
63 passing command line options to gutcheck or for testcases which are