| 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 | For information about how to run the test suite, read the usage |
| 9 | instructions in the comments at the top of the guile-test script. |
| 10 | |
| 11 | You can reference the file `lib.scm' from your own code as the module |
| 12 | (test-suite lib); it also has comments at the top and before each |
| 13 | function explaining what's going on. |
| 14 | |
| 15 | Please write more Guile tests, and send them to bug-guile@gnu.org. |
| 16 | We'll merge them into the distribution. All test suites must be |
| 17 | licensed for our use under the GPL, but I don't think I'm going to |
| 18 | collect assignment papers for them. |
| 19 | |
| 20 | |
| 21 | |
| 22 | Some test suite philosophy: |
| 23 | |
| 24 | GDB has an extensive test suite --- around 6300 tests. Every time the |
| 25 | test suite catches a bug, it's great. |
| 26 | |
| 27 | GDB is so complicated that folks are often unable to get a solid |
| 28 | understanding of the code before making a change --- we just don't |
| 29 | have time. You'll see people say things like, "Here's a fix for X; it |
| 30 | doesn't cause any regressions." The subtext is, I made a change that |
| 31 | looks reasonable, and the test suite didn't complain, so it must be |
| 32 | okay. |
| 33 | |
| 34 | I think this is terrible, because it suggests that the writer is using |
| 35 | the test suite as a substitute for having a rock-solid explanation of |
| 36 | why their changes are correct. The problem is that any test suite is |
| 37 | woefully incomplete. Diligent reasoning about code can catch corner |
| 38 | conditions or limitations that no test suite will ever find. |
| 39 | |
| 40 | |
| 41 | |
| 42 | Jim's rule for test suites: |
| 43 | |
| 44 | Every test suite failure should be a complete, mysterious surprise, |
| 45 | never a possibility you were prepared for. Any other attitude |
| 46 | indicates that you're using the test suite as a crutch, which you need |
| 47 | only because your understanding is weak. |