- Fix a bug in 'jar' utility

- Add support for running regression tests
- Respect LOCALBASE
- Bump PORTREVISION

These are the test results on:

FreeBSD 6 i386:  passed: 3113; failed: 29; error: 2
FreeBSD 8 amd64: passed: 3107; failed: 35; error: 2

Note: a couple of tests passed only after a few runs.

Submitted by:	ale
Approved by:	maintainer
This commit is contained in:
Alex Dupre
2010-01-21 08:51:59 +00:00
parent 6db4bb3f2f
commit fd0870acd9
5 changed files with 269 additions and 36 deletions
+48 -14
View File
@@ -7,25 +7,31 @@
PORTNAME= openjdk6
PORTVERSION= b17
PORTREVISION= 1
CATEGORIES= java devel
MASTER_SITES= http://download.java.net/openjdk/jdk6/promoted/${PORTVERSION}/ \
${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,}
${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:ant,} \
http://download.java.net/openjdk/jtreg/promoted/${JTREGVERSION}/:jtreg
DISTNAME= openjdk-6-src-${PORTVERSION}-${OPENJDK_BUILDDATE}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} ${ANTFILE}:ant
MAINTAINER= openjdk@getsnappy.com
COMMENT= Sun\'s java 6 virtual machine release under the GPL v2
BUILD_DEPENDS= zip:${PORTSDIR}/archivers/zip \
unzip:${PORTSDIR}/archivers/unzip \
${LOCALBASE}/include/cups/cups.h:${PORTSDIR}/print/cups-client
LIB_DEPENDS= freetype.9:${PORTSDIR}/print/freetype2
RUN_DEPENDS= javavm:${PORTSDIR}/java/javavmwrapper \
${LOCALBASE}/lib/X11/fonts/dejavu:${PORTSDIR}/x11-fonts/dejavu
BUILD_NUMBER= ${PORTVERSION:S/b//}
OPENJDK_BUILDDATE= 14_oct_2009
OPTIONS= DEBUG "Enable legacy debugging support" off \
FASTDEBUG "Include fastdebug build" off \
IPV6 "Enable IPv6 support" off \
POLICY "Install the Unlimited Strength Policy Files" off
POLICY "Install the Unlimited Strength Policy Files" off \
TEST "Add support for running regression test" off
# java extracts directly to the cwd
WRKSRC= ${WRKDIR}
@@ -34,17 +40,15 @@ USE_GMAKE= yes
USE_MOTIF= yes
USE_XORG= xtst xi xt x11
LIB_DEPENDS+= freetype.9:${PORTSDIR}/print/freetype2
BUILD_DEPENDS+= zip:${PORTSDIR}/archivers/zip
BUILD_DEPENDS+= unzip:${PORTSDIR}/archivers/unzip
BUILD_DEPENDS+= ${LOCALBASE}/include/cups/cups.h:${PORTSDIR}/print/cups-client
JTREGVERSION= b03
JTREGFILE= jtreg-4_0-bin-${JTREGVERSION}-31_mar_2009.zip
# do not depend on devel/apache-ant to avoid circular dependency, but
# use .tar.bz2 distfile to avoid duplicated downloads
ANTVERSION= 1.7.1
ANTFILE= apache-ant-${ANTVERSION}-bin.tar.bz2
# rely on bsdtar ability to extract .gz and .bz2 archives
# rely on bsdtar ability to extract .gz, .bz2 and .zip archives
EXTRACT_CMD= ${CAT}
EXTRACT_BEFORE_ARGS=
@@ -84,6 +88,7 @@ MAKE_ENV= LANG=C LC_ALL=C \
OS_NAME=freebsd \
ALT_JDK_IMPORT_PATH=${BOOTSTRAPJDKDIR} \
ALT_BOOTDIR=${BOOTSTRAPJDKDIR} \
ALT_CACERTS_FILE=${FILESDIR}/cacerts \
ALT_CUPS_HEADERS_PATH=${LOCALBASE}/include \
ALT_CUPS_LIB_PATH=${LOCALBASE}/lib \
ALT_FREETYPE_HEADERS_PATH=${LOCALBASE}/include \
@@ -91,8 +96,7 @@ MAKE_ENV= LANG=C LC_ALL=C \
ALT_X11_PATH=${LOCALBASE} \
ALT_PACKAGE_PATH=${LOCALBASE} \
ANT_HOME=${WRKDIR}/apache-ant-${ANTVERSION} \
BUILD_NUMBER=${BUILD_NUMBER} \
HS_BUILD_NUMBER=${BUILD_NUMBER} \
BUILD_NUMBER=${PORTVERSION} \
NO_DOCS=true \
MILESTONE=fcs
@@ -114,6 +118,12 @@ OPENJDK_OSARCH= bsd-${ARCH:S/i386/i586/}-debug
OPENJDK_OSARCH= bsd-${ARCH:S/i386/i586/}
.endif
.if defined(WITH_TEST)
DISTFILES+= ${JTREGFILE}:jtreg
BUILD_DEPENDS+= ${LOCALBASE}/lib/X11/fonts/dejavu:${PORTSDIR}/x11-fonts/dejavu
USE_DISPLAY= yes
.endif
BUILD_JOBS_NUMBER!= ${SYSCTL} -n kern.smp.cpus
MAKE_ENV+= HOTSPOT_BUILD_JOBS=${BUILD_JOBS_NUMBER}
@@ -168,10 +178,11 @@ post-extract:
@${SED} 's/solaris/bsd/g; s/Solaris/Bsd/g' \
< ${WRKDIR}/jdk/src/solaris/hpi/native_threads/src/threads_solaris.c \
> ${WRKDIR}/jdk/src/solaris/hpi/native_threads/src/threads_bsd.c
@${CP} ${FILESDIR}/fontconfig.properties \
${WRKDIR}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
@${CP} ${FILESDIR}/cacerts \
${WRKDIR}/jdk/src/share/lib/security/cacerts
@${SED} "s|/usr/local|${LOCALBASE}|" < ${FILESDIR}/fontconfig.properties \
> ${WRKDIR}/jdk/src/solaris/classes/sun/awt/fontconfigs/bsd.fontconfig.properties
@${SED} "s|%%LOCALBASE%%|${LOCALBASE}|" < ${FILESDIR}/Makefile.test \
> ${WRKDIR}/jdk/test/Makefile
@${FIND} ${WRKDIR}/jdk/test -type f -name \*.sh -exec ${SED} -i "" -e s/Linux/FreeBSD/g {} \;
.if defined(WITH_POLICY)
post-patch:
@@ -179,6 +190,29 @@ post-patch:
${WRKSRC}/jdk/make/javax/crypto/Makefile
.endif
.if defined(WITH_TEST)
post-build:
@${ECHO_MSG} ""
@${ECHO_MSG} "Run \"make test\" to execute regression test (it could take a few hours to complete)."
.if defined(DISPLAY)
@${ECHO_MSG} "Unset the environment DISPLAY variable to run tests in a virtual X server."
.endif
@${ECHO_MSG} ""
test: build-depends build
.if !defined(DISPLAY)
@${LOCALBASE}/bin/Xvfb :1001 -screen 0 800x600x24 -fp ${LOCALBASE}/lib/X11/fonts/misc > /dev/null 2>&1 & ${ECHO} $$! > ${WRKDIR}/.Xvfb.pid
.endif
@-(cd ${WRKSRC}/jdk/test; ${SETENV} ${MAKE_ENV} ${GMAKE} tests)
.if !defined(DISPLAY)
@-${CAT} ${WRKDIR}/.Xvfb.pid | ${XARGS} kill
@${RM} -f ${WRKDIR}/.Xvfb.pid
.endif
@${ECHO_MSG} ""
@${ECHO_MSG} "You can run \"make test\" again to re-execute only the failed tests."
@${ECHO_MSG} ""
.endif
do-install:
${MKDIR} ${PREFIX}/openjdk6/
${CP} -Rp ${WRKSRC}/build/${OPENJDK_OSARCH}/j2sdk-image/ ${PREFIX}/openjdk6/
+3
View File
@@ -4,3 +4,6 @@ SIZE (openjdk-6-src-b17-14_oct_2009.tar.gz) = 50029293
MD5 (apache-ant-1.7.1-bin.tar.bz2) = 9330447f3763b87570dd1118c49a8efd
SHA256 (apache-ant-1.7.1-bin.tar.bz2) = 24e54c9d90b81d1b7342695a8285a969393fd883e99ffbbc04203c106d9c2f97
SIZE (apache-ant-1.7.1-bin.tar.bz2) = 7641928
MD5 (jtreg-4_0-bin-b03-31_mar_2009.zip) = 99c4c119c2dd8e7a39c184896a56a00e
SHA256 (jtreg-4_0-bin-b03-31_mar_2009.zip) = 919b3da574a8bfb96a53d9550a0cb2482dc08df6ce3e7042235e0e9067c832e6
SIZE (jtreg-4_0-bin-b03-31_mar_2009.zip) = 4824967
+67
View File
@@ -0,0 +1,67 @@
#
# Makefile to run jtreg
#
ifeq ($(ARCH), i386)
ARCH = i586
endif
# Root of this test area (important to use full paths in some places)
TEST_ROOT := $(shell pwd)
# Default bundle of all test results (passed or not)
JPRT_ARCHIVE_BUNDLE = $(TEST_ROOT)/JPRT_ARCHIVE_BUNDLE.zip
JT_HOME = $(TEST_ROOT)/../../jtreg
JTREG_KEY_OPTION = -k:\!ignore
JTREG_ENV_OPTION = -e:LOCALBASE=%%LOCALBASE%%
JTREG_STATUS_OPTION = -status:notRun,fail,error
# Default JTREG to run
JTREG = $(ALT_JDK_IMPORT_PATH)/bin/java -jar $(JT_HOME)/lib/jtreg.jar
# Default JDK to test
JAVA_HOME = $(TEST_ROOT)/../../build/$(PLATFORM)-$(ARCH)/j2sdk-image
# The test directories to run
TESTDIRS = com demo java javax lib sun tools vm
# Root of all test results
JTREG_OUTPUT_DIR = $(TEST_ROOT)/o_$(PLATFORM)-$(ARCH)
# Default make rule
all: clean check tests $(JPRT_ARCHIVE_BUNDLE)
@echo "Testing completed successfully"
# Chaeck to make sure these directories exist
check: $(JT_HOME) $(JAVA_HOME)
# Run the tests
tests: FRC
@mkdir -p $(JTREG_OUTPUT_DIR)
$(JTREG) -a -v:fail,error \
$(JTREG_KEY_OPTION) \
$(JTREG_ENV_OPTION) \
$(JTREG_STATUS_OPTION) \
-r:$(JTREG_OUTPUT_DIR)/JTreport \
-w:$(JTREG_OUTPUT_DIR)/JTwork \
-jdk:$(JAVA_HOME) \
$(TESTDIRS)
# Bundle up the results
$(JPRT_ARCHIVE_BUNDLE): FRC
@rm -f $@
@mkdir -p $(@D)
( cd $(JTREG_OUTPUT_DIR) && %%LOCALBASE%%/bin/zip -q -r $@ . )
# Cleanup
clean:
rm -f -r $(JTREG_OUTPUT_DIR)
rm -f $(JPRT_ARCHIVE_BUNDLE)
# Used to force a target rules to run
FRC:
# Phony targets (e.g. these are not filenames)
.PHONY: all tests clean check
+19 -22
View File
@@ -8852,27 +8852,24 @@ diff -uNr ../orig/jdk/src/share/classes/sun/tools/jar/Main.java ./jdk/src/share/
// An entryName(path)->File map generated during "expand", it helps to
// decide whether or not an existing entry in a jar file needs to be
@@ -860,6 +861,19 @@
* Extracts specified entries from JAR file.
*/
void extract(InputStream in, String files[]) throws IOException {
+ // Current working directory
+
+ cwd = System.getProperty("user.dir");
+ if (cwd == null) {
+ fatalError(getMsg("error.no.cwd"));
+ }
+ cwd = (new File(cwd)).getCanonicalPath();
+ if (!cwd.endsWith(File.separator)) {
+ cwd += File.separator;
+ }
+
+ // Extract the files
+
ZipInputStream zis = new ZipInputStream(in);
ZipEntry e;
// Set of all directory entries specified in archive. Disallows
@@ -921,6 +935,10 @@
@@ -249,6 +250,16 @@
}
}
} else if (xflag) {
+ // Current working directory
+ cwd = System.getProperty("user.dir");
+ if (cwd == null) {
+ fatalError(getMsg("error.no.cwd"));
+ }
+ cwd = (new File(cwd)).getCanonicalPath();
+ if (!cwd.endsWith(File.separator)) {
+ cwd += File.separator;
+ }
+ // Extract the files
replaceFSC(files);
if (fname != null && files != null) {
extract(fname, files);
@@ -921,6 +932,10 @@
ZipEntry rc = null;
String name = e.getName();
File f = new File(e.getName().replace('/', File.separatorChar));
@@ -8883,7 +8880,7 @@ diff -uNr ../orig/jdk/src/share/classes/sun/tools/jar/Main.java ./jdk/src/share/
if (e.isDirectory()) {
if (f.exists()) {
if (!f.isDirectory()) {
@@ -942,6 +960,10 @@
@@ -942,6 +957,10 @@
} else {
if (f.getParent() != null) {
File d = new File(f.getParent());
+132
View File
@@ -0,0 +1,132 @@
--- jdk/test/java/nio/channels/SocketChannel/LocalAddress.java.orig 2010-01-18 12:03:26.000000000 +0100
+++ jdk/test/java/nio/channels/SocketChannel/LocalAddress.java 2010-01-18 12:03:42.000000000 +0100
@@ -40,7 +40,7 @@
InetAddress bogus = InetAddress.getByName("0.0.0.0");
SocketChannel sc = SocketChannel.open();
InetSocketAddress saddr = new InetSocketAddress(
- InetAddress.getByName(TestEnv.getProperty("host")), 23);
+ InetAddress.getByName(TestEnv.getProperty("host")), 7);
//Test1: connect only
sc.connect(saddr);
--- jdk/test/java/nio/channels/SocketChannel/Shutdown.java.orig 2010-01-18 12:04:09.000000000 +0100
+++ jdk/test/java/nio/channels/SocketChannel/Shutdown.java 2010-01-18 12:04:20.000000000 +0100
@@ -35,7 +35,7 @@
public static void main(String args[]) throws Exception {
InetSocketAddress sa = new InetSocketAddress(
- InetAddress.getByName(TestEnv.getProperty("host")), 23);
+ InetAddress.getByName(TestEnv.getProperty("host")), 7);
SocketChannel sc = SocketChannel.open(sa);
boolean before = sc.socket().isInputShutdown();
sc.socket().shutdownInput();
--- jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh.orig 2010-01-18 12:04:54.000000000 +0100
+++ jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh 2010-01-18 12:05:15.000000000 +0100
@@ -33,7 +33,7 @@
# The host that we try to resolve
-HOST=webcache.sfbay.sun.com
+HOST=developer.classpath.org
# fail gracefully if DNS is not configured or there
# isn't a CNAME record.
--- jdk/test/TestEnv.java.orig 2010-01-18 12:05:45.000000000 +0100
+++ jdk/test/TestEnv.java 2010-01-18 12:06:40.000000000 +0100
@@ -65,14 +65,14 @@
// Reachable host with the following services running:
// - echo service (port 7)
// - day time port (port 13)
- { "host", "javaweb.sfbay.sun.com" },
+ { "host", "icedtea.classpath.org" },
// Reachable host that refuses connections to port 80
- { "refusing_host", "jano1.sfbay.sun.com" },
+ { "refusing_host", "ns1.gnu.org" },
// Reachable host that is of sufficient hops away that a connection
// takes a while to be established (connect doesn't complete immediatly)
- { "far_host", "irejano.ireland.sun.com" },
+ { "far_host", "developer.classpath.org" },
// Hostname that cannot be resolved by named service
{ "unresovable_host", "blah-blah.blah-blah.blah" },
--- jdk/test/java/io/File/GetXSpace.java.orig 2010-01-20 14:12:07.000000000 +0100
+++ jdk/test/java/io/File/GetXSpace.java 2010-01-20 14:12:25.000000000 +0100
@@ -49,7 +49,7 @@
private static final String name = System.getProperty("os.name");
private static final String dfFormat;
static {
- if (name.equals("SunOS") || name.equals("Linux")) {
+ if (name.equals("FreeBSD") || name.equals("SunOS") || name.equals("Linux")) {
// FileSystem Total Used Available Use% MountedOn
dfFormat = "([^\\s]+)\\s+(\\d+)\\s+\\d+\\s+(\\d+)\\s+\\d+%\\s+([^\\s]+)";
} else if (name.startsWith("Windows")) {
--- jdk/test/tools/pack200/MemoryAllocatorTest.java.orig 2010-01-20 14:47:29.000000000 +0100
+++ jdk/test/tools/pack200/MemoryAllocatorTest.java 2010-01-20 14:48:02.000000000 +0100
@@ -81,6 +81,7 @@
static final boolean debug = Boolean.getBoolean("MemoryAllocatorTest.Debug");
static final boolean WINDOWS = System.getProperty("os.name").startsWith("Windows");
+ static final boolean FREEBSD = System.getProperty("os.name").startsWith("FreeBSD");
static final boolean LINUX = System.getProperty("os.name").startsWith("Linux");
static final boolean SIXTYFOUR_BIT = System.getProperty("sun.arch.data.model", "32").equals("64");
static final private int NATIVE_EXPECTED_EXIT_CODE = (WINDOWS) ? -1 : 255;
@@ -424,7 +425,7 @@
* the error message is not accurate for us to discern if the test
* passes successfully.
*/
- if (SIXTYFOUR_BIT && (LINUX || WINDOWS)) {
+ if (SIXTYFOUR_BIT && (FREEBSD || LINUX || WINDOWS)) {
System.out.println("Warning: Windows/Linux 64bit tests passes vacuously");
return;
}
--- jdk/test/tools/pack200/Pack200Simple.sh.orig 2010-01-20 14:48:44.000000000 +0100
+++ jdk/test/tools/pack200/Pack200Simple.sh 2010-01-20 14:50:05.000000000 +0100
@@ -134,7 +134,7 @@
# A quick crc compare test to ensure a well formed zip
# archive, this is a critical unpack200 behaviour.
- unzip -t $jfName > ${jfName}.unzip.log 2>&1
+ ${LOCALBASE}/bin/unzip -t $jfName > ${jfName}.unzip.log 2>&1
if [ $? != 0 ]; then
errorOut "$jfName unzip -t test failed"
fi
--- jdk/test/java/lang/ProcessBuilder/Zombies.java.orig 2010-01-20 15:54:25.000000000 +0100
+++ jdk/test/java/lang/ProcessBuilder/Zombies.java 2010-01-20 15:54:41.000000000 +0100
@@ -49,11 +49,11 @@
} catch (IOException _) {/* OK */}
try {
- rt.exec("/bin/true", null, new File("no-such-dir"));
+ rt.exec("/usr/bin/true", null, new File("no-such-dir"));
throw new Error("expected IOException not thrown");
} catch (IOException _) {/* OK */}
- rt.exec("/bin/true").waitFor();
+ rt.exec("/usr/bin/true").waitFor();
// Count all the zombies that are children of this Java process
final String[] zombieCounter = {
--- jdk/test/java/lang/ProcessBuilder/Basic.java.orig 2010-01-20 16:02:00.000000000 +0100
+++ jdk/test/java/lang/ProcessBuilder/Basic.java 2010-01-20 16:05:07.000000000 +0100
@@ -1096,7 +1096,7 @@
String[] cmdp = childArgs.toArray(new String[childArgs.size()]);
String[] envp = {"=ExitValue=3", "=C:=\\"};
Process p = Runtime.getRuntime().exec(cmdp, envp);
- String expected = Windows.is() ? "=C:=\\,=ExitValue=3," : "=C:=\\,";
+ String expected = Windows.is() ? "=C:=\\,=ExitValue=3," : "";
equal(commandOutput(p), expected);
if (Windows.is()) {
ProcessBuilder pb = new ProcessBuilder(childArgs);
--- jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java.orig 2010-01-20 16:17:05.000000000 +0100
+++ jdk/test/java/lang/management/OperatingSystemMXBean/GetSystemLoadAverage.java 2010-01-20 16:19:55.000000000 +0100
@@ -79,7 +79,7 @@
System.out.println("Test passed.");
}
- private static String LOAD_AVERAGE_TEXT = "load average:";
+ private static String LOAD_AVERAGE_TEXT = "load averages:";
private static void checkLoadAvg() throws Exception {
// Obtain load average from OS command
ProcessBuilder pb = new ProcessBuilder("/usr/bin/uptime");