1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
|
This is Mauve, a free test suite for the Java Class Libraries.
Mauve is intended to test several different varieties of the
libraries. For instance, it will contain tests that are specific to a
particular JDK version. Tags in the test files help the test
framework decide which tests should or should not be run against a
given runtime.
This file has two main sections:
0) CONFIGURING AND BUILDING THE TESTSUITE
1) RUNNING THE TESTS
2) NOTES
******CONFIGURING AND BUILDING THE TESTSUITE*******
To build, first run configure. Below we cover the following:
0. Specifying which VM to test.
1. Configuring the auto-compilation feature.
2. Environment variables for configure.
3. Other options to configure.
4. Building the testsuite.
0. Specifying the VM to test.
The configure script takes the following option that specifies which java
implementation the testsuite will test:
--with-vm=TESTVM
For example, specifying --with-vm=jamvm will invoke "jamvm" when
running the tests, and will therefore test the java implementation associated
with your jamvm installation. If this option is not specified, it defaults
to "java".
1. Configuring the auto-compilation feature.
If you plan to use the auto-compilation feature of the Harness, which
compiles tests inline before running them (so new tests, or changed
tests are run properly without an additional step), you need to be sure
it is properly configured. The following options are associated
with auto-compilation:
--enable-auto-compilation Enable the auto-compilation feature
--with-ecj-jar Specify the location of the eclipse-ecj.jar
file for the compiler to use. This defaults
to /usr/share/java/eclipse-ecj.jar and only
needs to be specified if the location on your
machine is different from this. If no valid
ecj jar is found, auto-compilation will be
turned off.
--with-bootclasspath Specify the bootclasspath for the compiler.
Auto-compilation is enabled by default, and the bootclasspath is found
automatically. If you wish to disable auto-compilation or change the
bootclasspath you should use the appropriate option(s) above.
2. Environment variables for configure.
You can control the configuration with some environment variables:
JAVA Name of Java interpreter to use
JAVAC Name of Java (to class) compiler to use
GCJ Name of Java (to object) compiler to use
GCJ is only used when the `--with-gcj' option is given to configure.
3. Other configure options.
The configure script also supports the following `--with' options:
--with-gcj Indicate you will be using gcj, this will tell
make to build the object files and use the
appropriate compiler
--with-tmpdir=DIR Put temporary files in DIR
defaults to `/tmp'
--with-mailhost=HOSTNAME Use mail server at HOSTNAME for socket tests
defaults to `mx10.gnu.org'
(Use this option if your local firewall
blocks outgoing connections on port 25.)
4. Building the testsuite.
If you are using the auto-compilation feature, there is no need to build the
tests, it will suffice to compile the files Harness.java and
RunnerProcess.java.
If you are using gcj or are not using the auto-compilation feature, you should
now run GNU make to build the testsuite.
*******RUNNING THE TESTS*******
The Mauve tests are run using the harness script in the top directory. This
section provides instructions on how to perform the following tasks:
0. Running all the tests.
1. Specify the VM on which to run the tests and any VM arguments
2. Select a subset of the tests to run
3. Use an input file to specify the tests to run
4. Change the timeout interval
5. Change the information displayed when tests are run
6. Turn on (or off) test auto-compilation.
7. Test output format
0. Running all the tests
To run all the tests in the Mauve test suite, type 'HARNESSVM Harness' where
HARNESSVM is the VM you wish to use to run the Harness. Note that this is NOT
the same as the VM on which you run the tests. Read item 1 to learn how to
set the VM on which you run the tests.
You can also run all the tests by typing 'HARNESSVM Harness gnu.testlet'.
1. Specifying the VM on which to run the tests and any VM arguments
The VM on which to run the tests can be specified by configure as described
in the first section, CONFIGURING AND BUILDING THE TESTSUITE. It can also be
done via command line options to the Harness (which override the configure
options). To set the VM via the command line, use:
-vm [vmpath]
If, for example, I wanted to run all the JTable tests using JamVM, and then
run them all on Sun's VM for comparison, I would type:
HARNESSVM Harness javax.swing.JTable -vm jamvm
and then
HARNESSVM Harness javax.swing.JTable -vm java
if "java" was a system command to run Sun's VM. If not, you should specify
the path to Sun's "java" executable (ex: /usr/lib/java-1.5.0/bin/java). Note
again that HARNESSVM is just the VM used to run the harness, and not the tests.
This is done for performance considerations to allow the Harness to be natively
compiled and ran while testing a variety of VMs.
To specify arguments for the VM, use:
-vmarg ARGUMENT
For example, the following command will run the JTable tests on JamVM with
the -Xnocompact argument:
HARNESSVM Harness javax.swing.JTable -vm jamvm -vmarg -Xnocompact
For debugging purposes it may be helpful to run the testprocess with a
special program like strace, time or gdb. To prepend such a command before
the VM use the -vmprefix argument and specify a path to the program you want
to run:
-vmprefix [prefixpath]
For example, the following command will run a Socket test with strace on
Cacao:
HARNESSVM Harness java.net.Socket -vm cacao -vmprefix strace
2. Selecting a subset of the tests to run
This is a common task for developers, you may be working to fix a bug in a
certain area and want to run all the related tests, but not the entire
testsuite. Simply specify the folder containing the tests, and all the tests
in that folder (and its subfolders, although this can be turned off) will be
run.
Example: run all the java.net tests (remember, this uses system default
"java" unless you have environment variable MAUVEVM set):
1. HARNESSVM Harness java.net
2. HARNESSVM Harness gnu.testlet.java.net
3. HARNESSVM Harness gnu/testlet/java/net
3. HARNESSVM Harness gnu/testlet/java/net/
* It makes no difference if you use "." or "/", or if you have the
"gnu.testlet" preceeding the test folder or if you have a trailing "/".
You may want to exclude certain tests from a run, this done using the
-exclude option. Extending our previous example, let's run all the java.net
tests except for the java.net.Socket tests.
1. HARNESSVM Harness java.net -exclude java.net.Socket
2. HARNESSVM Harness -exclude java.net.Socket java.net
The test or folder you want to exclude must follow the -exclude option, but
other than that, the order doesn't matter. In example #2 above java.net is
still taken to be tests you want to run, not tests you want to exclude. So
if you want to exclude more than one folder, you need to use the -exclude
flag multiple times.
If a folder has several subfolders and you want to exclude them all, you
can use the -norecursion option instead of explicitly excluding them
all. So to run the AbstractDocument tests but not the BranchElement or
LeafElement tests, type:
HARNESSVM Harness javax.swing.text.AbstractDocument -norecursion
Again, the order of the arguments/options doesn't matter.
3. Using an input file to specify tests to be run
Simply use the -file [filename] option. The input file should list, one per
line, the tests or folders you want to test.
Example: HARNESSVM Harness -file myInputFile
The input file specifies only tests to be run, not excluded, to exclude tests
you need to explicitly do so as in Section 2 above.
Example: HARNESSVM Harness -file myInputFile -exclude java.net.Socket
4. Changing the timeout interval
The Harness detects tests that have hung and terminates them. It does so
simply by allowing all tests to run for 60 seconds and if they haven't
completed, declaring them hung. If a test simply takes a long time you may
want to increase this interval. If on the other hand, no passing tests take
longer than a few seconds and hanging tests are slowing down your test runs,
you may want to decrease the interval. To set the timeout interval use
the -timeout [interval] option. The interval is specified in milliseconds.
Example: HARNESSVM Harness gnu.java.security -timeout 30000
will set the timeout to be 30 seconds instead of 60.
5. Changing the information displayed during test runs
By default the Harness prints only messages for those tests that fail, and
prints full stack traces for uncaught exceptions. The following
options affect what is printed:
-hidecompilefails: hides failures from the compiler. These can still be
found in the .ecjErr file.
-verbose: prints information about each passing harness.check() call
within the tests, whether they pass or fail.
-noexceptions: suppress full stack traces for uncaught exceptions
-showpasses: prints one-line summaries for passing tests
-debug: prints toString() information when a
harness.check(Object, Object) call fails.
6. Turning off (or on) test auto-compilation
The auto-compilation feature is enabled by default, but can be turned off by
using the --disable-auto-compilation option to configure. You can also turn
off the option by using the following Harness option:
-compile no OR -compile false
If you have disabled auto-compilation in configure but wish to turn it on
for a particular test run, use
-compile yes OR -compile true
Note that auto-compilation requires a correct path to eclipse-ecj.jar and
a correct bootclasspath. The following options deal with this:
-bootclasspath BOOTCLASSPATH
-ecj-jar ECJ_JAR_LOCATION
These can also be specified at configure time via
--with-bootclasspath and --with-ecj-jar, the latter defaulting
to /usr/share/java/eclipse-ecj.jar if no location is specified. The default
bootclasspath is found automatically and shouldn't need to be changed unless
you specifically want to specify an alternate location.
So the default setup of:
1. ./configure
2. make
3. HARNESSVM Harness
will run with auto-compilation enabled with the ecj jar being
/usr/share/java/eclipse-ecj.jar and the bootclasspath found automatically.
7. Test output format
Test results are available in xml format by use of the '-xmlout' and '-autoxml' flags
'-xmlout' is supplied with the xml file name where the total test run data will be stored:
HARNESSVM Harness -xmlout XML_FILE
'-autoxml' is supplied with the directory name, where individual xml files will be generated
and stored for each test executed:
HARNESSVM Harness -autoxml RESULTS_DIRECTORY
******NOTES*******
This section explains some additional notes to take into account when using
Mauve. It has the following subsections:
0. External Data
0. External Data
Tests can have additional data included. Usually, data is located either
in the same package of the test, or in a subpackage.
The following files come from external sources. The list includes the
last known license at time the file was added, the source and the location
in Mauve. For details on the use see the corresponding tests.
* gnu/testlet/javax/sound/sampled/data/k3b_success1.wav, GPL,
k3b-1.0.1-1.fc7.2 (fedora 7)
* gnu/testlet/javax/sound/sampled/data/k3b_success1.au, GPL,
converted from k3b_success1.wav.
|