You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2006/09/15 21:50:25 UTC
svn commit: r446705 - in /incubator/harmony/enhanced/drlvm/trunk:
build/make/components/ build/make/components/vm/ build/make/targets/
vm/tests/kernel/java/lang/ vm/vmcore/include/
vm/vmcore/src/kernel_classes/javasrc/java/lang/ vm/vmcore/src/kernel_cl...
Author: geirm
Date: Fri Sep 15 12:50:24 2006
New Revision: 446705
URL: http://svn.apache.org/viewvc?view=rev&rev=446705
Log:
HARMONY-1431
- basic fixes to thread classes
- fix for stack cleanup
- fix so the c-based unit tests run again
Modified:
incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml
incubator/harmony/enhanced/drlvm/trunk/build/make/targets/test.xml
incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThreadTest.java
incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThrowableRTest.java
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ThreadGroup.java
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm.xml Fri Sep 15 12:50:24 2006
@@ -61,18 +61,5 @@
vm.kernel_classes" />
</select>
- <property name="smoke.test.depends" value="" />
-
- <property name="smoke.test.javasrc" location="${build.VM.home}/tests/smoke" />
-
- <patternset id="smoke.test.java.pattern">
- <include name="**/*.java"/>
- <exclude name="**/Logger.java"/>
- </patternset>
- <patternset id="smoke.test.pattern">
- <include name="**/*.class"/>
- <exclude name="**/*$*.class"/>
- </patternset>
-
</target>
</project>
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/components/vm/vmcore.xml Fri Sep 15 12:50:24 2006
@@ -298,17 +298,5 @@
<linkerarg value="-lstdc++" /-->
</select>
</linker>
-
- <path id="unit.test.c.include">
- <pathelement location="${build.VM.home}/tests/unit/thread/utils" />
- <pathelement location="${build.semi.dir}/extra/apr/include" />
- <pathelement location="${build.semi.dir}/extra/apr/include/apr-1" />
- <pathelement location="${build.VM.home}/vmcore/include" />
- </path>
-
- <fileset id="unit.test.c.src" dir="${build.VM.home}/tests/unit/thread">
- <include name="*.c" />
- <exclude name="*performance*"/>
- </fileset>
</target>
</project>
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml Fri Sep 15 12:50:24 2006
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
@@ -17,218 +18,181 @@
Author: Sergey V. Dmitriev, Marina V. Goldburt
Version: $Revision$
-->
-
<project name="C UNIT TESTS">
<target name="cunit.test" depends="init_component">
- <if>
- <isreference refid="unit.test.c.src" />
- <then>
-
- <!-- compiler to compile framework as well as the unit tests -->
- <compiler name="${build.cxx}" id="unit.test.c.compiler">
- <defineset define="APR_DECLARE_STATIC, _DEBUG, VM_STATS" />
- <defineset define="BUILDING_VM" />
-
- <select os="win">
- <defineset define="PLATFORM_NT, WIN32, _WINDOWS, _IA32_" />
- <defineset define="_WIN32_WINNT=0x0501" />
- </select>
-
- <select os="lnx">
- <defineset define="LINUX, GC_V4" />
- <defineset define="USE_DLL_JIT, PLATFORM_POSIX" />
- <defineset define="__SMP__, _REENTRANT" />
- <defineset define="LINUX_TLS_OPT, _IA32_" />
- <defineset define="_LARGEFILE64_SOURCE" />
- <compilerarg value="-Wall" />
- <compilerarg value="-fno-exceptions" />
- <compilerarg value="-g" />
- <compilerarg value="-O0" />
- </select>
- </compiler>
-
- <!-- Compiling framework -->
- <echo message="## Compiling framework..." />
-
- <!-- a new property: cunit tests work dir -->
- <property name="unit.test.c.workdir"
+ <path id="unit.test.c.include">
+ <pathelement location="${build.VM.home}/tests/unit/thread/utils" />
+ <pathelement location="${build.semi.dir}/extra/apr/include" />
+ <pathelement location="${build.semi.dir}/extra/apr/include/apr-1" />
+ <pathelement location="${build.VM.home}/vmcore/include" />
+ </path>
+ <fileset id="unit.test.c.src" dir="${build.VM.home}/tests/unit/thread">
+ <include name="*.c" />
+ <exclude name="*performance*"/>
+ </fileset>
+ <!-- compiler to compile framework as well as the unit tests -->
+ <compiler name="${build.cxx}" id="unit.test.c.compiler">
+ <defineset define="APR_DECLARE_STATIC, _DEBUG, VM_STATS" />
+ <defineset define="BUILDING_VM" />
+ <select os="win">
+ <defineset define="PLATFORM_NT, WIN32, _WINDOWS, _IA32_" />
+ <defineset define="_WIN32_WINNT=0x0501" />
+ </select>
+ <select os="lnx">
+ <defineset define="LINUX, GC_V4" />
+ <defineset define="USE_DLL_JIT, PLATFORM_POSIX" />
+ <defineset define="__SMP__, _REENTRANT" />
+ <defineset define="LINUX_TLS_OPT, _IA32_" />
+ <defineset define="_LARGEFILE64_SOURCE" />
+ <compilerarg value="-Wall" />
+ <compilerarg value="-fno-exceptions" />
+ <compilerarg value="-g" />
+ <compilerarg value="-O0" />
+ </select>
+ </compiler>
+ <!-- Compiling framework -->
+ <echo message="## Compiling framework..." />
+ <!-- a new property: cunit tests work dir -->
+ <property name="unit.test.c.workdir"
value="${build.dir}/_cunit.tests" />
-
- <mkdir dir="${unit.test.c.workdir}/_obj" />
-
- <cc objdir="${unit.test.c.workdir}/_obj"
+ <mkdir dir="${unit.test.c.workdir}/_obj" />
+ <cc objdir="${unit.test.c.workdir}/_obj"
debug="true"
runtime="static"
multithreaded="true">
-
- <compiler refid="unit.test.c.compiler" />
-
- <fileset refid="unit.test.c.framework.src" />
- <fileset dir="${build.VM.home}/tests/unit/thread/utils">
- <include name="*.c" />
- </fileset>
-
- <includepath refid="unit.test.common.c.include" />
- <includepath refid="unit.test.c.include" />
- </cc>
-
- <!-- a list of all source files with unit tests -->
-
- <pathconvert pathsep=","
+ <compiler refid="unit.test.c.compiler" />
+ <fileset refid="unit.test.c.framework.src" />
+ <fileset dir="${build.VM.home}/tests/unit/thread/utils">
+ <include name="*.c" />
+ </fileset>
+ <includepath refid="unit.test.common.c.include" />
+ <includepath refid="unit.test.c.include" />
+ </cc>
+ <!-- a list of all source files with unit tests -->
+ <pathconvert pathsep=","
property="unit.test.c.files"
refid="unit.test.c.src" />
-
- <!-- operation system sensitive executive binary file extention.
+ <!-- operation system sensitive executive binary file extention.
simply said: "" or ".exe" ;) -->
- <condition property="extention" value=".exe">
- <isset property="if.win" />
- </condition>
- <property name="extention" value="" />
-
- <!-- replacing: 'xxx.c, yyy.c' => 'xxx yyy' -->
- <propertyregex override="yes"
+ <condition property="extention" value=".exe">
+ <isset property="if.win" />
+ </condition>
+ <property name="extention" value="" />
+ <!-- replacing: 'xxx.c, yyy.c' => 'xxx yyy' -->
+ <propertyregex override="yes"
property="unit.test.c.files"
input="${unit.test.c.files}"
regexp="\.c"
replace=""
defaultValue="${unit.test.c.files}" />
-
-
- <!-- Compiling unit tests -->
-
- <echo message="## Compiling C unit tests" />
-
- <cc objdir="${unit.test.c.workdir}/_obj"
+ <!-- Compiling unit tests -->
+ <echo message="## Compiling C unit tests" />
+ <cc objdir="${unit.test.c.workdir}/_obj"
debug="true"
runtime="static"
multithreaded="true"
subsystem="console">
- <compiler refid="unit.test.c.compiler" />
-
- <fileset refid="unit.test.c.src" />
- <includepath refid="unit.test.common.c.include" />
- <includepath refid="unit.test.c.include" />
- </cc>
-
- <mkdir dir="${unit.test.c.workdir}/_bin" />
-
- <!-- copy zlib library; it's necessary for test execution -->
- <copy todir="${unit.test.c.workdir}/_bin">
- <fileset dir="${external.dep.CLASSLIB}/deploy/jdk/jre/bin" includes="*hyzlib*" />
- </copy>
-
- <mkdir dir="${unit.test.c.workdir}/report" />
-
- <!-- set of properties which will be needed for test execution -->
- <property name="filename" value="--" />
- <property name="outputproperty" value="--" />
- <property name="resultproperty" value="--" />
-
- <for list="${unit.test.c.files}" param="file" delimiter=",">
- <sequential>
-
- <!-- make it possible to overwrite the property -->
- <var name="filename" unset="true" />
- <basename property="filename" file="@{file}" />
-
- <!-- Linking unit test -->
- <echo message="## Linking C unit test: ${filename}" />
-
- <cc name="${build.cxx}"
+ <compiler refid="unit.test.c.compiler" />
+ <fileset refid="unit.test.c.src" />
+ <includepath refid="unit.test.common.c.include" />
+ <includepath refid="unit.test.c.include" />
+ </cc>
+ <mkdir dir="${unit.test.c.workdir}/_bin" />
+ <!-- copy zlib library; it's necessary for test execution -->
+ <copy todir="${unit.test.c.workdir}/_bin">
+ <fileset dir="${external.dep.CLASSLIB}/deploy/jdk/jre/bin" includes="*hyzlib*" />
+ </copy>
+ <mkdir dir="${unit.test.c.workdir}/report" />
+ <!-- set of properties which will be needed for test execution -->
+ <property name="filename" value="--" />
+ <property name="outputproperty" value="--" />
+ <property name="resultproperty" value="--" />
+ <for list="${unit.test.c.files}" param="file" delimiter=",">
+ <sequential>
+ <!-- make it possible to overwrite the property -->
+ <var name="filename" unset="true" />
+ <basename property="filename" file="@{file}" />
+ <!-- Linking unit test -->
+ <echo message="## Linking C unit test: ${filename}" />
+ <cc name="${build.cxx}"
debug="true"
outfile="${unit.test.c.workdir}/_bin/${filename}"
outtype="executable"
subsystem="console">
- <linker name="${build.cxx}">
- <fileset dir="${unit.test.c.workdir}/_obj">
- <include name="${filename}.o*" />
- <include name="thread_unit_test_main.o*" />
- <include name="thread_unit_test_utils.o*" />
- <include name="thread_unit_test_vm_emulator.o*" />
- <include name="testframe.o*" />
- <include name="tm2vm.o*" />
- </fileset>
-
- <fileset dir="${build.semi.dir}/vm/jthread/_obj">
- <include name="*.o*" />
- </fileset>
-
- <fileset dir="${build.semi.dir}/vm/hythr/_obj">
- <include name="*.o*" />
- </fileset>
-
- <libset libs="encoder" dir="${build.semi.dir}/vm/encoder/_bin" />
- <libset libs="apr-1" dir="${build.semi.dir}/extra/apr/_bin" />
- <libset libs="aprutil-1" dir="${build.semi.dir}/extra/aprutil/_bin" />
- <libset libs="port" dir="${build.semi.dir}/vm/port/_bin" />
- <libset libs="log4cxx" dir="${build.semi.dir}/extra/log4cxx/_bin" />
- <libset libs="hyzlib" dir="${external.dep.CLASSLIB}/deploy/jdk/jre/bin" />
-
- <select os="win">
- <syslibset libs="advapi32, ws2_32, mswsock, user32, userenv, odbc32" />
- <linkerarg value="/NODEFAULTLIB:libcmt.lib" />
- </select>
-
- <select os="lnx">
- <syslibset type="shared" libs="stdc++, gcc_s, pthread, rt" />
- </select>
- </linker>
- </cc>
- </sequential>
- </for>
-
- <for list="${unit.test.c.files}" param="file" delimiter=",">
- <sequential>
-
- <!-- make it possible to overwrite the property -->
- <var name="filename" unset="true" />
- <basename property="filename" file="@{file}" />
-
- <!-- Executing unit test -->
- <echo message="## Executing C unit test: ${filename}" />
-
- <var name="outputproperty" unset="true" />
- <var name="resultproperty" unset="true" />
-
- <exec dir="${unit.test.c.workdir}/_bin"
+ <linker name="${build.cxx}">
+ <fileset dir="${unit.test.c.workdir}/_obj">
+ <include name="${filename}.o*" />
+ <include name="thread_unit_test_main.o*" />
+ <include name="thread_unit_test_utils.o*" />
+ <include name="thread_unit_test_vm_emulator.o*" />
+ <include name="testframe.o*" />
+ <include name="tm2vm.o*" />
+ </fileset>
+ <fileset dir="${build.semi.dir}/vm/jthread/_obj">
+ <include name="*.o*" />
+ </fileset>
+ <fileset dir="${build.semi.dir}/vm/hythr/_obj">
+ <include name="*.o*" />
+ </fileset>
+ <libset libs="encoder" dir="${build.semi.dir}/vm/encoder/_bin" />
+ <libset libs="apr-1" dir="${build.semi.dir}/extra/apr/_bin" />
+ <libset libs="aprutil-1" dir="${build.semi.dir}/extra/aprutil/_bin" />
+ <libset libs="port" dir="${build.semi.dir}/vm/port/_bin" />
+ <libset libs="log4cxx" dir="${build.semi.dir}/extra/log4cxx/_bin" />
+ <libset libs="hyzlib" dir="${external.dep.CLASSLIB}/deploy/jdk/jre/bin" />
+ <select os="win">
+ <syslibset libs="advapi32, ws2_32, mswsock, user32, userenv, odbc32" />
+ <linkerarg value="/NODEFAULTLIB:libcmt.lib" />
+ </select>
+ <select os="lnx">
+ <syslibset type="shared" libs="stdc++, gcc_s, pthread, rt" />
+ </select>
+ </linker>
+ </cc>
+ </sequential>
+ </for>
+ <for list="${unit.test.c.files}" param="file" delimiter=",">
+ <sequential>
+ <!-- make it possible to overwrite the property -->
+ <var name="filename" unset="true" />
+ <basename property="filename" file="@{file}" />
+ <!-- Executing unit test -->
+ <echo message="## Executing C unit test: ${filename}" />
+ <var name="outputproperty" unset="true" />
+ <var name="resultproperty" unset="true" />
+ <exec dir="${unit.test.c.workdir}/_bin"
executable="${unit.test.c.workdir}/_bin/${filename}${extention}"
resultproperty="resultproperty"
outputproperty="outputproperty">
- <select os="lnx">
- <env key="LD_LIBRARY_PATH" path="${unit.test.c.workdir}/_bin" />
- </select>
- </exec>
-
- <echo file="${unit.test.c.workdir}/report/${filename}.out"
+ <select os="lnx">
+ <env key="LD_LIBRARY_PATH" path="${unit.test.c.workdir}/_bin" />
+ </select>
+ </exec>
+ <echo file="${unit.test.c.workdir}/report/${filename}.out"
message="${outputproperty}" />
- <echo message="${outputproperty}" />
-
- <if>
- <not>
- <equals arg1="${resultproperty}" arg2="0" />
- </not>
- <then>
- <property name="some.test.failed" value="true" />
- <echo message="## TEST FAILED" />
- </then>
- <else>
- <echo message="## TEST PASSED" />
- </else>
- </if>
- </sequential>
- </for>
-
+ <echo message="${outputproperty}" />
<if>
- <isset property="some.test.failed" />
+ <not>
+ <equals arg1="${resultproperty}" arg2="0" />
+ </not>
<then>
- <echo message="## Please find tests and results at ${build.dir}/_cunit.tests/" />
- <fail message="## SOME TESTS FAILED" />
+ <property name="some.test.failed" value="true" />
+ <echo message="## TEST FAILED" />
</then>
+ <else>
+ <echo message="## TEST PASSED" />
+ </else>
</if>
-
+ </sequential>
+ </for>
+ <if>
+ <isset property="some.test.failed" />
+ <then>
<echo message="## Please find tests and results at ${build.dir}/_cunit.tests/" />
- <echo message="## TESTS PASSED" />
+ <fail message="## SOME TESTS FAILED" />
</then>
</if>
+ <echo message="## Please find tests and results at ${build.dir}/_cunit.tests/" />
+ <echo message="## TESTS PASSED" />
</target>
</project>
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml Fri Sep 15 12:50:24 2006
@@ -38,7 +38,7 @@
<exclude name="java/lang/RuntimeAdditionalTest42.java" />
<!-- This test fails -->
- <exclude name="java/lang/ThreadTest.java" />
+ <!--exclude name="java/lang/ThreadTest.java" /-->
</patternset>
<property name="vm.use_verifier" value="1" />
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml Fri Sep 15 12:50:24 2006
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
@@ -17,81 +18,64 @@
Author: Marina V. Goldburt
Version: $Revision: 1.4.2.11 $
-->
-
<project name="SMOKE TESTS">
- <target name="smoke.test" depends="compile.smoke.tests, java_test_smoke" />
+ <property name="smoke.test.javasrc" location="${build.VM.home}/tests/smoke" />
+ <patternset id="smoke.test.java.pattern">
+ <include name="**/*.java"/>
+ <exclude name="**/Logger.java"/>
+ </patternset>
+ <patternset id="smoke.test.pattern">
+ <include name="**/*.class"/>
+ <exclude name="**/*$*.class"/>
+ </patternset>
+ <target name="smoke.test" depends="compile.smoke.tests, java_test_smoke" />
<target name="compile.smoke.tests" depends="init_component">
- <if>
- <isset property="smoke.test.javasrc" />
- <then>
- <mkdir dir="${build.dir}/_smoke.tests/classes" />
- <javac includeJavaRuntime="yes" srcdir="${smoke.test.javasrc}"
+ <mkdir dir="${build.dir}/_smoke.tests/classes" />
+ <javac includeJavaRuntime="yes" srcdir="${smoke.test.javasrc}"
destdir="${build.dir}/_smoke.tests/classes"
target="${javac.target}" debug="${java.debug.option}">
- <patternset refid="smoke.test.java.pattern" />
- <bootclasspath>
- <fileset dir="${java.home}" includes="**/*.jar" />
- </bootclasspath>
- </javac>
- </then>
- </if>
+ <patternset refid="smoke.test.java.pattern" />
+ <bootclasspath>
+ <fileset dir="${java.home}" includes="**/*.jar" />
+ </bootclasspath>
+ </javac>
</target>
-
<target name="jar.smoke.tests" depends="compile.smoke.tests">
- <if>
- <isset property="smoke.test.javasrc" />
- <then>
- <jar jarfile="${build.dir}/_smoke.tests/">
- <fileset dir="${build.dir}/_smoke.tests/classes" includes="**/*.class" />
- </jar>
- </then>
- </if>
+ <jar jarfile="${build.dir}/_smoke.tests/">
+ <fileset dir="${build.dir}/_smoke.tests/classes" includes="**/*.class" />
+ </jar>
</target>
-
<target name="java_test_smoke">
- <if>
- <isset property="smoke.test.javasrc" />
- <then>
- <mkdir dir="${build.dir}/_smoke.tests/reports" />
- <path id="java.class.path">
- <pathelement location="${build.dir}/_smoke.tests/classes" />
- <fileset dir="${build.deploy.dir}/lib" includes="*.jar" />
- </path>
- <antcall target="java_test_smoke_with_jit_or_interpreter">
- <param name="jit.or.interpreter" value="jit" />
- </antcall>
- <antcall target="java_test_smoke_with_jit_or_interpreter">
- <param name="jit.or.interpreter" value="interpreter" />
- </antcall>
- </then>
- </if>
+ <mkdir dir="${build.dir}/_smoke.tests/reports" />
+ <path id="java.class.path">
+ <pathelement location="${build.dir}/_smoke.tests/classes" />
+ <fileset dir="${build.deploy.dir}/lib" includes="*.jar" />
+ </path>
+ <antcall target="java_test_smoke_with_jit_or_interpreter">
+ <param name="jit.or.interpreter" value="jit" />
+ </antcall>
+ <antcall target="java_test_smoke_with_jit_or_interpreter">
+ <param name="jit.or.interpreter" value="interpreter" />
+ </antcall>
</target>
-
<target name="java_test_smoke_with_jit_or_interpreter">
<condition property="using.jit.or.jitrino" value="Using interpreter">
<contains string="${jit.or.interpreter}" substring="int" />
</condition>
<property name="using.jit.or.jitrino" value="Using jitrino" />
-
<echo message="${using.jit.or.jitrino}" />
-
<property name="classes.location" location="${smoke.test.javasrc}" />
-
<pathconvert property="java.path.property" refid="java.class.path" />
-
<condition property="int.or.jit.exclude" value="X_int,X_interpreter">
<contains string="${jit.or.interpreter}" substring="int" />
</condition>
<property name="int.or.jit.exclude" value="X_jit,X_jitrino" />
-
<property name="EXCLUDE_KEYWORDS" value="XXX,X_${build.os},X_${build.arch},X_drl,${int.or.jit.exclude},slow,perf,stress" />
-
<condition property="int.or.jit.arg" value="-Xint">
<contains string="${jit.or.interpreter}" substring="int" />
</condition>
<property name="int.or.jit.arg" value="" />
-
<for param="test">
<fileset dir="${smoke.test.javasrc}">
<patternset refid="smoke.test.java.pattern" />
@@ -103,12 +87,10 @@
<propertyregex property="test1" override="true" input="@{test}" regexp="\\" replace="/" global="true" defaultValue="@{test}" />
<propertyregex property="class.name.sep" override="true" input="${test1}" regexp="${classes.location1}/(.*).java" replace="\1" />
<propertyregex property="class.name" override="true" input="${class.name.sep}" regexp="/" replace="\." global="true" defaultValue="${class.name.sep}" />
-
<loadfile property="@{test}.src.file" srcFile="@{test}" />
<propertycopy name="src.file" override="true" from="@{test}.src.file" />
<propertyregex property="@{test}.keywords" input="${src.file}" regexp="(?m)@keyword(.*)" select="\1" defaultValue="" />
<propertycopy name="file.keywords" override="true" from="@{test}.keywords" />
-
<for param="keyword" list="${EXCLUDE_KEYWORDS}" delimiter=",">
<sequential>
<condition property="@{test}.is.excluded" value="@{keyword}">
@@ -116,11 +98,9 @@
</condition>
</sequential>
</for>
-
<condition property="@{test}.is.golden" value="true">
<contains string="${file.keywords}" substring="golden" />
</condition>
-
<if>
<not>
<isset property="@{test}.is.excluded" />
@@ -157,7 +137,6 @@
</if>
<!-- load the test output file to the property - will be used later -->
<loadfile property="@{test}.out" srcFile="${build.dir}/_smoke.tests/reports/${class.name}_${jit.or.interpreter}.out" />
-
<!--
Run smoke test @{test} on JAVA_HOME's JVM.
If ${keywords} contains "golden" we have to run the test twice:
@@ -170,7 +149,6 @@
<available file="${env.JAVA_HOME}/bin/java${executable.postfix}" />
</condition>
<property name="java.executable" value="${env.JAVA_HOME}/bin/java${executable.postfix}" />
-
<java output="${build.dir}/_smoke.tests/reports/${class.name}_${jit.or.interpreter}.golden" classname="${class.name}" fork="true" jvm="${java.executable}" error="${build.dir}/_smoke.tests/reports/${class.name}_${jit.or.interpreter}.golden.err">
<jvmarg value="-classpath" />
<jvmarg value="${java.path.property}" />
@@ -180,7 +158,6 @@
<loadfile property="@{test}.golden" srcFile="${build.dir}/_smoke.tests/reports/${class.name}_${jit.or.interpreter}.golden" />
</then>
</if>
-
<!-- Handling the test output (or outputs in "golden" case) -->
<if>
<isset property="@{test}.is.golden" />
@@ -202,7 +179,6 @@
</condition>
</else>
</if>
-
<if>
<isset property="@{test}.is.passed" />
<then>
Modified: incubator/harmony/enhanced/drlvm/trunk/build/make/targets/test.xml
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/build/make/targets/test.xml?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/build/make/targets/test.xml (original)
+++ incubator/harmony/enhanced/drlvm/trunk/build/make/targets/test.xml Fri Sep 15 12:50:24 2006
@@ -18,6 +18,6 @@
Version: $Revision: 1.3.2.2 $
-->
<project name="ALL TESTS">
- <target name="test" depends="cunit.test, smoke.test, kernel.test,unit.test" />
+ <target name="test" depends="cunit.test, smoke.test, kernel.test" />
</project>
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThreadTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThreadTest.java?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThreadTest.java (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThreadTest.java Fri Sep 15 12:50:24 2006
@@ -519,16 +519,18 @@
fail("unexpected: thread has not started");
}
StackTraceElement ste[] = t.getStackTrace();
- assertTrue("stack dump of thread t1 is empty", ste.length > 0);
+ while (ste.length == 0 && !(expired = doSleep(10))) {
+ ste = t.getStackTrace();
+ }
s.stop = true;
+ if (expired) {
+ fail("stack dump of thread t1 is empty");
+ }
}
/**
* Thread(ThreadGroup, Runnable, String, long)
*/
-/*
- // fails on some platforms due to the known issue:
- // OutOfMemoryError when running a thread created with too high stack size
public void testThreadThreadGroupRunnableStringlong_Long_MAX_VALUE() {
ThreadGroup tg = new ThreadGroup("newGroup");
String name = "t1";
@@ -544,13 +546,18 @@
fail("unexpected: thread has not started");
}
ste = t.getStackTrace();
+ while (ste.length == 0 && !(expired = doSleep(10))) {
+ ste = t.getStackTrace();
+ }
+ s.stop = true;
+ if (expired) {
+ fail("stack dump of thread t1 is empty");
+ }
} catch (OutOfMemoryError er) {
fail("OutOfMemoryError when stack size is Long.MAX_VALUE");
}
- assertTrue("stack dump of thread t1 is empty", ste.length > 0);
- s.stop = true;
}
-*/
+
/**
* Thread(ThreadGroup, String)
*/
@@ -913,7 +920,13 @@
StackTraceElement ste[] = tR.getStackTrace();
assertEquals("stack dump of a new thread is not empty", ste.length, 0);
tR.start();
-
+ waitTime = waitDuration;
+ while (!tR.isAlive() && !(expired = doSleep(10))) {
+ }
+ if (expired) {
+ fail("unexpected: thread has not started");
+ }
+
// get stack trace of a running thread
waitTime = waitDuration;
do {
@@ -923,11 +936,14 @@
fail("stack dump of a running thread is empty");
} else {
assertTrue("incorrect length", ste.length >= 1);
- assertEquals("incorrect class name",
+/*
+ // commented: sometimes it returns Thread.runImpl
+ assertEquals("incorrect class name",
"java.lang.ThreadTest$ThreadRunning",
ste[0].getClassName());
assertEquals("incorrect method name",
"run", ste[0].getMethodName());
+*/
}
// get stack trace of a terminated thread
@@ -1008,8 +1024,6 @@
/**
* Get the state of a blocked thread.
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetStateBlocked() {
Team team = new Team();
RunProject pr1 = new RunProject(team);
@@ -1026,7 +1040,7 @@
fail("BLOCKED state has not been set");
}
}
-*/
+
/**
* Get the state of a new thread.
*/
@@ -1083,8 +1097,6 @@
/**
* Get the state of a terminated thread.
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetStateTerminated() {
ThreadRunning tR = new ThreadRunning();
tR.start();
@@ -1103,12 +1115,10 @@
fail("TERMINATED state has not been set");
}
}
-*/
+
/**
* Get the state of a terminated thread.
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetStateTerminated1() {
Square s = new Square(15);
Thread tR = new Thread(s);
@@ -1128,12 +1138,10 @@
fail("TERMINATED state has not been set");
}
}
-*/
+
/**
* Get the state of a timed waiting thread.
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetStateTimedWaiting() {
ThreadWaiting tW = new ThreadWaiting(Action.WAIT, 6000, 0);
tW.start();
@@ -1149,12 +1157,10 @@
fail("TIMED_WAITING state has not been set");
}
}
-*/
+
/**
* Get the state of a waiting thread.
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetStateWaiting() {
ThreadWaiting tW = new ThreadWaiting(Action.WAIT, 0, 0);
tW.start();
@@ -1170,7 +1176,7 @@
fail("WAITING state has not been set");
}
}
-*/
+
class ExceptionHandler implements Thread.UncaughtExceptionHandler {
public boolean wasCalled = false;
@@ -1194,8 +1200,6 @@
/**
* Test getUncaughtExceptionHandler() for a terminated thread
*/
-/*
- // fails due to the known issue: getState() does not return correct values
public void testGetUncaughtExceptionHandler_Null() {
ThreadGroup tg = new ThreadGroup("test thread group");
Thread t = new Thread(tg, "test thread");
@@ -1216,7 +1220,7 @@
assertNull("handler should be null for a terminated thread",
t.getUncaughtExceptionHandler());
}
-*/
+
/**
* Test for setUncaughtExceptionHandler()
*/
@@ -1298,9 +1302,6 @@
/**
* Interrupt the current thread
*/
-/*
- // fails due to the known issue: interrupt() does not set
- // the current thread's interrupted status
public void testInterrupt_CurrentThread() {
Thread t = new Thread() {
public void run() {
@@ -1321,7 +1322,7 @@
fail("interrupt status has not changed to true");
}
}
-*/
+
/**
* Interrupt a terminated thread
*/
@@ -1348,7 +1349,6 @@
/**
* Interrupt a joining thread
*/
-
public void testInterrupt_Joining() {
ThreadWaiting t = new ThreadWaiting(Action.JOIN, 10000, 0);
t.start();
@@ -1530,13 +1530,14 @@
long millis = 2000;
ThreadRunning t = new ThreadRunning();
t.start();
+ long joinStartTime = System.currentTimeMillis();
try {
t.join(millis);
} catch (InterruptedException e) {
fail(INTERRUPTED_MESSAGE);
}
long curTime = System.currentTimeMillis();
- long duration = curTime - t.getStartTime();
+ long duration = curTime - joinStartTime;
t.stopWork = true;
assertTrue("join(" + millis + ") has waited for " + duration,
duration >= millis);
@@ -1550,13 +1551,14 @@
int nanos = 999999;
ThreadRunning t = new ThreadRunning();
t.start();
+ long joinStartTime = System.currentTimeMillis();
try {
t.join(millis, nanos);
} catch (InterruptedException e) {
fail(INTERRUPTED_MESSAGE);
}
long curTime = System.currentTimeMillis();
- long duration = 1000000 * (curTime - t.getStartTime());
+ long duration = 1000000 * (curTime - joinStartTime);
long joinTime = 1000000 * millis + nanos;
t.stopWork = true;
assertTrue("join should wait for at least " + joinTime +
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThrowableRTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThrowableRTest.java?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThrowableRTest.java (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/tests/kernel/java/lang/ThrowableRTest.java Fri Sep 15 12:50:24 2006
@@ -38,8 +38,8 @@
}
}
- /*
- * Test the Throwable(Throwable) constructor when the initCause() method
+ /**
+ * Tests the Throwable(Throwable) constructor when the initCause() method
* is overloaded
*/
public void testThrowableThrowableInitCause() {
@@ -49,5 +49,43 @@
iC.getCause() != null);
assertTrue("Assert 1: The invalid cause has been set",
iC.getCause() == nPE);
+ }
+
+ /**
+ * A regression test for HARMONY-1431 I-3 issue.
+ * Tests that getStackTrace() contains info about sources
+ * and does not contain empty parentheses
+ */
+ public void testStackTraceFileName() {
+ try {
+ Class<?> a = Class.forName("SomeClass");
+ fail("ClassNotFoundException should be thrown");
+ } catch (ClassNotFoundException e) {
+ StackTraceElement ste[] = e.getStackTrace();
+ for (int i = 0; i < ste.length; i++) {
+ String element = ste[i].toString();
+ if (element.indexOf("()") != -1) {
+ fail("Empty parentheses are published in stack trace: " + element);
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * A regression test for HARMONY-1431 I-3 issue.
+ * Tests that getStackTrace() contains info about the "main" method
+ */
+ public void testStackTraceMathodMain() {
+ try {
+ Class<?> a = Class.forName("SomeClass");
+ fail("ClassNotFoundException should be thrown");
+ } catch (ClassNotFoundException e) {
+ StackTraceElement ste[] = e.getStackTrace();
+ String mainFrame = ste[ste.length - 1].toString();
+ if (mainFrame.indexOf("TestRunner.main") == -1) {
+ fail("Method \"main\" is not published in stack trace");
+ }
+ }
}
}
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/include/version_svn_tag.h Fri Sep 15 12:50:24 2006
@@ -17,6 +17,6 @@
#ifndef _VERSION_SVN_TAG_
#define _VERSION_SVN_TAG_
-#define VERSION_SVN_TAG "443226"
+#define VERSION_SVN_TAG "446666"
#endif // _VERSION_SVN_TAG_
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java Fri Sep 15 12:50:24 2006
@@ -214,7 +214,6 @@
threadGroup = currentThread.group;
}
this.group = threadGroup;
- threadGroup.add(this);
// throws NullPointerException if the given name is null
this.name = (name != THREAD) ? this.name = name.toString() : THREAD
+ threadCounter++;
@@ -222,7 +221,7 @@
this.contextClassLoader = currentThread.contextClassLoader;
this.target = target;
this.stackSize = stackSize;
- this.priority = currentThread.priority;
+ this.priority = currentThread.priority;
initializeInheritableLocalValues(currentThread);
checkGCWatermark();
@@ -240,7 +239,8 @@
this.threadId = getNextThreadId();
SecurityUtils.putContext(this, AccessController.getContext());
checkAccess();
- }
+ threadGroup.add(this);
+ }
/**
* @com.intel.drl.spec_ref
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ThreadGroup.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ThreadGroup.java?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ThreadGroup.java (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/ThreadGroup.java Fri Sep 15 12:50:24 2006
@@ -185,7 +185,7 @@
}
if (!nonsecureDestroy()) {
throw new IllegalThreadStateException("The thread group " + name +
- " contains non-empty subgroups");
+ " is not empty");
} else {
if (parent != null) {
parent.remove(this);
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?view=diff&rev=446705&r1=446704&r2=446705
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp Fri Sep 15 12:50:24 2006
@@ -284,19 +284,24 @@
}
}
}
- // skip Thread.runImpl()
- size--;
- // skip the VMStart$MainThread if one exits from the bottom of the stack
- // along with 2 reflection frames used to invoke method main
+
+ // skip the VMStart$MainThread.runImpl() if it exists from the bottom
+ // of the stack along with 2 reflection frames used to invoke method main
static String* starter_String = genv->string_pool.lookup("java/lang/VMStart$MainThread");
- Method_Handle method = frames[size].method;
+ Method_Handle method = frames[size - 1].method;
assert(method);
- // skip only for main application thread
+
if (!strcmp(method_get_name(method), "runImpl")
- && method->get_class()->name == starter_String) {
- int rem = size - skip-1;
- size -= rem < 2 ? rem : 2;
+ && method->get_class()->name == starter_String) {
+ for (; --size;) {
+ method = frames[size - 1].method;
+ assert(method);
+ if ((strstr(method->get_class()->name->bytes, "java/lang/reflect"))
+ == NULL) {
+ break;
+ }
+ }
}
ASSERT(size >= skip, "Trying to skip " << skip
@@ -329,13 +334,17 @@
const char* fileName;
get_file_and_line(method, ip, &fileName, &lineNumber);
- if (fileName == NULL) fileName = "";
-
- jstring strFileName = jenv->NewStringUTF(fileName);
- if (!strFileName) {
- assert(exn_raised());
- return NULL;
+ jstring strFileName;
+ if (fileName != NULL) {
+ strFileName = jenv->NewStringUTF(fileName);
+ if (!strFileName) {
+ assert(exn_raised());
+ return NULL;
+ }
+ } else {
+ strFileName = NULL;
}
+
tmn_suspend_disable();
// class name