1 Guile Testing Framework for GNU Classpath
2 Written by Paul Fisher (rao@gnu.org)
4 GNU Classpath tests are written in Java. Guile is responsible for
5 executing the tests and organizing the results. Guile and Java
6 communicate through JNI. If JNI is unavailable, see the section on
7 modifying the framework to allow for an alternate means of
8 communication. [This has not been written. -PF]
10 All tests must implement gnu.test.Test. gnu.test.Test contains two
16 When getName() is called, your test should return the name of the
17 test. When test() is called, your test should be performed. Upon
18 completion of the test (either through success or failure), a Result
19 object is returned. test() may throw runtime exceptions and errors --
20 if this happens, an implicit error result is returned.
22 There are seven predefined result types, including the POSIX 1003.3
23 result codes. All result objects may optionally be constructed with a
24 single String argument specifying additional information about the
27 gnu.test.Pass : Test passed and was excepted to pass.
28 gnu.test.XPass : Test passed but was expected to fail.
29 gnu.test.Fail : Test failed but was expected to pass.
30 gnu.test.XFail : Test failed and was expected to fail.
31 gnu.test.Unresolved : Test produced indeterminate results.
32 gnu.test.Untested : Test was not run -- a placeholder.
33 gnu.test.Unsupported : Test does not have the required support to run.
35 (Error is also a valid result type, but only in Guile/JNI code.)
37 System.out and System.err are used for directing additional
38 information about the running test. System.out should be used to send
39 status messages when tests are expected to take large amounts of time.
40 System.err should be used to send messages which are logged to the
46 public class StringCharAtZeroTest implements Test
49 return "java.lang.String.charAt(0)";
52 public Result test() {
53 char ch = "foobar".charAt(0);
57 return new Fail("zero index of \"foobar\" is '" + ch + "'");
61 It's often desirable to group multiple tests together into one file.
62 In this case, inner classes should be used. There's also the added
63 benefit that tests can easily share data through static variables in
69 public class TestContainer {
70 public static class test1 implements Test {
78 public static class test2 implements Test {
88 The testsuite contains a file known as "tests.to.run" which contains a
89 newline delimited listing of all tests to be executed. Just add the
90 name of the new test to the file and it'll be included in future runs
93 Running the testsuite:
94 guile-jvm -s test.scm tests.to.run
96 (It would be more natural for the testsuite to read from standard in
97 if a file was not specified, but read-line in Guile 1.3a is broken.)
99 Classes are located via the environmental variable CLASSPATH.
101 Results are sent to two log files -- one summary (classpath.sum) and
102 one verbose (classpath.log).