You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Nathan Beyer <nd...@apache.org> on 2009/08/03 04:33:06 UTC
Re: svn commit: r800182 - /harmony/enhanced/classlib/trunk/modules/portlib/build.xml
Please test out this change on various platforms. I found that the
native tests wouldn't run correctly on Windows Vista with the multiple
PATH variables, so I added these conditional checks and this produces
the cleanest environment setup for Windows Vista.
If there are other ways of accomplishing this, it can certainly be reworked.
-Nathan
On Sun, Aug 2, 2009 at 9:25 PM, <nd...@apache.org> wrote:
> Author: ndbeyer
> Date: Mon Aug 3 02:25:25 2009
> New Revision: 800182
>
> URL: http://svn.apache.org/viewvc?rev=800182&view=rev
> Log:
> rework native test environment setup to work on Windows
>
> Modified:
> harmony/enhanced/classlib/trunk/modules/portlib/build.xml
>
> Modified: harmony/enhanced/classlib/trunk/modules/portlib/build.xml
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/build.xml?rev=800182&r1=800181&r2=800182&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/portlib/build.xml (original)
> +++ harmony/enhanced/classlib/trunk/modules/portlib/build.xml Mon Aug 3 02:25:25 2009
> @@ -285,16 +285,41 @@
> <sequential>
> <property name="@{test}.name"
> value="native.portlib.@{test}" />
> - <exec executable="src/test/native/@{test}/@{test}${exe.suffix}"
> +
> + <!--
> + The following three conditions are a way of working around Ant's
> + environment variable handling on Windows. Windows environment variables
> + are NOT case-sensitive, but Ant's 'env.XXX' variables are case-sensitive.
> + -->
> + <condition property="exec.env.path.name" value="path">
> + <isset property="env.path" />
> + </condition>
> + <condition property="exec.env.path.value" value="${env.path}">
> + <isset property="env.path" />
> + </condition>
> +
> + <condition property="exec.env.path.name" value="Path">
> + <isset property="env.Path" />
> + </condition>
> + <condition property="exec.env.path.value" value="${env.Path}">
> + <isset property="env.Path" />
> + </condition>
> +
> + <condition property="exec.env.path.name" value="PATH">
> + <isset property="env.PATH" />
> + </condition>
> + <condition property="exec.env.path.value" value="${env.PATH}">
> + <isset property="env.PATH" />
> + </condition>
> +
> + <exec executable="${basedir}/src/test/native/@{test}/@{test}${exe.suffix}"
> failonerror="false"
> outputproperty="@{test}.output"
> resultproperty="@{test}.resultcode" >
> - <env key="PATH"
> - path="${env.Path}${path.separator}${env.PATH}${path.separator}${hy.jdk}/jre/bin${hy.thr.libpath}" />
> - <env key="Path"
> - path="${env.Path}${path.separator}${env.PATH}${path.separator}${hy.jdk}/jre/bin${hy.thr.libpath}" />
> + <env key="${exec.env.path.name}"
> + path="${exec.env.path.value}:${hy.jdk}/jre/bin${hy.thr.libpath}" />
> <env key="LD_LIBRARY_PATH"
> - path="${env.LD_LIBRARY_PATH}${path.separator}${hy.jdk}/jre/bin${hy.thr.libpath}" />
> + path="${hy.jdk}/jre/bin${hy.thr.libpath}" />
> </exec>
> <condition property="@{test}.result" value="passed" else="FAILED">
> <equals arg1="${@{test}.resultcode}" arg2="0" />
>
>
>