Automated Testing for PHP Development Tools Releases

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

1. Create a root directory named "tests" directory
2. Extract the all-in-one/pdt-all-in-one-I<latest-date>-win32/mac/linux.zip (For example: pdt-all-in-one-I20070101-win32.zip) to tests/pdt-testing directory.
3. Extract pdt-Automated-Tests-I<latest-date>.zip (For example: pdt-Automated-Tests-I20070101.zip) to the tests directory.
4. copy the tests/pdt-testing files to the tests directory.
5. Extract tests/pdt-junit-tests-.zip (For example: tests/pdt-junit-tests-I20070101.zip)
6. Extract eclipse-test-framework-3.2.1.zip Note: When a Confirmation Dialog appears - Click Overwrite All

Running Tests

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.

Parameters

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. At a minimum, the property file must include a "J2SE-5.0" property which specifies a path to a 1.5 java executable, for example: J2SE-5.0="c:/program files/jdk1.5.0_06/jre/bin/java" 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". However, the -vm value is ignored by the inner vm for JUnit plug-in tests requiring a 1.5 JRE to execute (see test targets). This property must be used in conjunction with the -properties parameter described above at all times.
-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. For example, runtests -os linux -ws gtk -arch x86 ant antui -properties vm.properties This will execute the "ant" and "antui" test targets only. If not specified, the "all" target will be executed.

Appendix A - Test Targets

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