Description
This document describes how to install and run the PDT JUnit test plugins from a command line. This method is intended for anyone who wishes to run the test written by the PDT team, and can be used in order to automate their testing process.
Requirements
1. Java runtime environment version 1.4 or 1.5. See test targets for details on which tests require
the 1.5 version. All other tests can be executed with either JRE levels.
2. The Eclipse test framework distribution- this package is supplied
with each and every one of the eclipse releases (for example - (eclipse-test-framework-3.2.1.zip).
3. Info-ZIP
UnZip version 5.41 or later
Setup
From a command prompt or terminal:
1. cd to the pdt-testing directory
2. Execute the following script:
Windows: runtests [-vm "path/to/java"]
Mac OS: runtests –ws (i.e carbon) –os (macosx) –arch (i.e ppc)
Linux: runtests –ws (i.e gtx) –os (linux) –arch (i.e x86)
All parameters and targets are optional. On *nix systems, the os, ws and arch parameters must be specified in addition to the -properties parameter.
| Parameter | Description |
| -os <operating system> | The OS the tests are being run on. One of: aix, hpux, linux, macosx, qnx, solaris, win32. Default win32 |
| -ws <windowing system> | The windowing system the tests are being run on. One of: carbon, motif, gtk, photon, win32. Default win32 |
| -arch <architecture> | The architecture the tests are being run on. One of: ppc, PA_RISC, x86, sparc. Default x86 |
| -noclean | Run tests without installing a clean Eclipse (in "test-eclipse") between test targets. Default is to delete an existing test-eclipse directory and re-extract the Eclipse distribution between test targets. |
| -properties |
As per requirements noted above, this is used to reference a
properties file containing additional Ant properties used in running
tests.Can be used to pass additional vm arguments to the Java virtual
machine running the tests by adding the entry
"extraVMargs=<the args to pass to the vm>" to the
specified properties file. The path must be enclosed in double quotes if it contains spaces. This key-value pair is required to run JUnit plug-in tests that require a 1.5 level jvm. |
| -vm |
When runtests is executed, two instances of eclipse are
started: one to invoke the org.eclipse.ant.core.antRunner application
to run a test.xml script in a test plug-in (outer instance) and
another in which the JUnit tests are being executed (inner). By
default, both will use the java executable on the system path. The -vm
property is used to specify an alternate java executable. For example,
"-vm c:\jdk142\jre\bin\java". |
| -Dtest.target=performance | Runs the performance target only in each test plug-in's test.xml. When running tests on Windows, enclose this parameter in double quotes, ie. runtests "-Dtest.target=performance". |
| targetname1 targetname2 targetname3 etc.. |
Replace with a list of test targets
to execute (space delineated). Each corresponds to an Ant target in
the eclipse-testing/test.xml script. |
Ant targets in the main test.xml which execute tests. Typically
each corresponds to the execution of a test plug-in's test.xml.
| Target name (special jvm requirements) | Description / test plug-in |
| all (1.4 and 1.5 JREs required) | Runs all the targets below. Default. |
| Bare | org.eclipse.php.test.BareSuiteCase |
| Headless | org.eclipse.php.test.HeadlessSuiteCase |
| GUI | org.eclipse.php.test.GUISuiteCase |
Appendix B- Supported os, ws, and arch value combinations
The following table contains the values that can be used with the -os, -ws, and -arch switches.
| Operating System (os) | Windowing System (ws) | Architecture (arch) |
| aix | motif | ppc |
| hpux | motif | PA_RISC |
| linux | gtk | x86 |
| linux | gtk | x86_64 |
| linux | gtk | ppc |
| linux | motif | x86 |
| macosx | carbox | ppc |
| solaris | gtk | sparc |
| solaris | motif | sparc |
| win32 | win32 | x86 |