Mission and Status
Harmony Unit Tests (aka HUT) are one of Harmony's core test suites. HUTs consist of unit tests for classes from all classlib modules and include API tests, implementation-specific tests and regression tests. API tests normally reside in <module root>/src/test/api folder, implementation-specific in <module root>/src/test/impl. Regression tests are usually marked with comments that contain numbers of corresponding JIRA issues.
HUTs can be effectively used for regression testing. All Harmony committers and contributors are strongly encouraged to run these tests before creating patches or committing changes to Harmony repository.
How to configure and run Harmony Unit Tests
Make sure that PATH environment variable contains JDK 1.5 (use RI) and Apache Ant (v1.6.5 or later), and that JAVA_HOME and ANT_HOME are properly set up. If you use proxy server, specify proxy settings by setting ANT_OPTS environment variable:
Before running the tests you may need to download required dependencies and build classlib itself. This can be achieved by doing the following:
Let's assume you have compiled JRE you want to run the tests on at <JRE home>. The following command will run all non-excluded unit tests:
NOTE: exclude lists for Harmony Unit Tests are plain text files that reside in <module root>/make directory and contain names of java files with excluded tests. Excluded tests won't be included into the test run under normal conditions.
To run tests from the selected classlib module only (i.e. beans, luni and etc.) you should type:
You may also specify a pattern for the test class name to run. Please see the examples below.
Pay attention to fact that if you specify a pattern then processing of exclude lists is not performed. Thus the following command will run all BEANS tests regardless the exclude lists (please be careful since this may crash the VM ):
You may also pass some parameters like JIT modes and heap size to JRE under test by utilizing hy.test.vmargs system property. For example:
Test reports can be found at <classlib trunk>/build/test_report .