Running jtreg
jtreg is the test harness used by the OpenJDK test framework. The script linux/jtreg
is a shell script that runs fine on Mac OS X. It will run all the tests under $SRC/jdk/.
By default jtreg will use the current jvm for running both the test harness and the tests themselves.
The examples below use the jtreg option -jdk
to specify the JDK compiled in the macosx-port source directory.
Example: running all the jdk tests (takes a long time):
cd <path-to-macosx-port-source>/jdk/ <path to jtreg>/linux/bin/jtreg -jdk:../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/ -v:summary test
Example: running just the jdk java/lang tests (approximately 340 tests; completes in about 6 minutes):
cd <path-to-macosx-port-source>/jdk/ <path to jtreg>/linux/bin/jtreg -jdk:../build/macosx-universal/j2sdk-bundle/1.7.0.jdk/Contents/Home/ -v:summary test/java/lang
If you run jtreg
by making a symbolic link to linux/jtreg
in another directory already on your PATH
you will need to export a JT_HOME
environmental variable.
Apple JUnit harness conversion to jtreg
- 5% of tests converted
Tests Converted to macosx-port/jdk/test/
- java/awt/Button/BasicButton.java
- java/awt/Component/SetBackground/TwoInOne.java
- java/awt/GrapicsDevice/GrapicsDevicesTest.java (com.apple.junit.java.awt.Device.GrapicsDevicesTest)
- java/io/File/R2226785File_delete.java
- java/io/File/R2254176FileClosing.java
- java/io/File/R2256773File_getPath.java
- java/io/File/R2297115File_mkdir.java
- java/io/File/R2385593ListFileSlash.java
- java/io/File/R2391232FileSlashDot.java
- java/io/File/R2405276ListCurDir.java
- java/io/File/R2408635SpecialCharacters.java
- java/io/File/R2426905CrashOnEmptyFilename.java
- java/io/File/R4978208MultipleUmlautsTest.java
- java/lang/Double/R1388007FloatOverflow.java
- java/lang/Math/R1400112FloatPrecisionTest.java
- java/lang/Math/VampireNumbers.java
- java/net/Socket/GetLocalAddressTest.java
- java/util/Date/R1610789DateTests.java
- java/util/Date/R1651062DateMonthParse.java
- java/util/Date/R2452208DateEpochFormat.java
- java/vm/R3569904ThreadedAppendDoubleDivByZeroTest.java
jtreg known failures
- java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java (Issue: MACOSX_PORT-5)