More tweaks.
[bpt/guile.git] / test-suite / README
1 This directory contains some tests for Guile, and some generic test
2 support code.
3
4 To run these tests, you will need a version of Guile more recent than
5 15 Feb 1999 --- the tests use the (ice-9 and-let*) and (ice-9
6 getopt-long) modules, which were added to Guile around then.
7
8 To run the test suite, you'll need to:
9 - edit the path to the guile interpreter in `guile-test', and
10 - edit the paths in `paths.scm', so `guile-test' can find the test
11 scripts.
12
13 Once that's done, you can just run the `guile-test' script. That
14 script has usage instructions in the comments at the top.
15
16 You can reference the file `lib.scm' from your own code as the module
17 (test-suite lib); it also has comments at the top and before each
18 function explaining what's going on.
19
20 Please write more Guile tests, and send them to bug-guile@gnu.org.
21 We'll merge them into the distribution. All test suites must be
22 licensed for our use under the GPL, but I don't think I'm going to
23 collect assignment papers for them.
24
25
26
27 Some test suite philosophy:
28
29 GDB has an extensive test suite --- around 6300 tests. Every time the
30 test suite catches a bug, it's great.
31
32 GDB is so complicated that folks are often unable to get a solid
33 understanding of the code before making a change --- we just don't
34 have time. You'll see people say things like, "Here's a fix for X; it
35 doesn't cause any regressions." The subtext is, I made a change that
36 looks reasonable, and the test suite didn't complain, so it must be
37 okay.
38
39 I think this is terrible, because it suggests that the writer is using
40 the test suite as a substitute for having a rock-solid explanation of
41 why their changes are correct. The problem is that any test suite is
42 woefully incomplete. Diligent reasoning about code can catch corner
43 conditions or limitations that no test suite will ever find.
44
45
46
47 Jim's rule for test suites:
48
49 Every test suite failure should be a complete, mysterious surprise,
50 never a possibility you were prepared for. Any other attitude
51 indicates that you're using the test suite as a crutch, which you need
52 only because your understanding is weak.