Skip to content
Permalink
Browse files
Add tests for running the tasks in a directory with spaces in its name
git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/dotnet/trunk@497298 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bodewig committed Jan 18, 2007
1 parent b94920e commit feebaef24c989e460269d5c9934597f97a6075bc
Showing 3 changed files with 224 additions and 0 deletions.
@@ -0,0 +1,138 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="compilation in dir with spaces" basedir="." default="echo"
xmlns:au="antlib:org.apache.ant.antunit"
xmlns:dn="antlib:org.apache.ant.dotnet">

<property name="source.dir" location="src"/>
<property name="dest.dir" location="dest"/>

<target name="probe_for_apps" >
<property environment="env"/>

<condition property="ilasm.found">
<or>
<available file="ilasm.exe" filepath="${env.Path}" />
<available file="ilasm.exe" filepath="${env.PATH}" />
<available file="ilasm" filepath="${env.PATH}" />
</or>
</condition>

<condition property="csc.found">
<or>
<available file="csc.exe" filepath="${env.Path}" />
<available file="csc.exe" filepath="${env.PATH}" />
<available file="mcs" filepath="${env.PATH}" />
</or>
</condition>

<condition property="vbc.found">
<or>
<available file="vbc.exe" filepath="${env.Path}" />
<available file="vbc.exe" filepath="${env.PATH}" />
<available file="vbc" filepath="${env.PATH}" />
</or>
</condition>

<condition property="jsharp.found">
<or>
<available file="vjc.exe" filepath="${env.Path}" />
<available file="vjc.exe" filepath="${env.PATH}" />
<available file="vjc" filepath="${env.PATH}" />
</or>
</condition>

<condition property="ildasm.found">
<or>
<available file="ildasm.exe" filepath="${env.Path}" />
<available file="ildasm.exe" filepath="${env.PATH}" />
<available file="ildasm" filepath="${env.PATH}" />
</or>
</condition>

</target>

<target name="setUp">
<mkdir dir="${source.dir}"/>
<mkdir dir="${dest.dir}"/>
<copy todir="${source.dir}">
<fileset dir="../src">
<include name="example*"/>
<include name="*.java"/>
</fileset>
</copy>
</target>

<target name="tearDown">
<delete dir="${source.dir}"/>
<delete dir="${dest.dir}"/>
</target>

<target name="testCSC" depends="probe_for_apps" if="csc.found">
<property name="testCSC.exe"
location="${dest.dir}/ExampleCsc.exe" />
<au:assertFileDoesntExist file="${testCSC.exe}"/>
<dn:csc
destFile="${testCSC.exe}"
targetType="exe"
srcDir="${source.dir}"
>
</dn:csc>
<au:assertFileExists file="${testCSC.exe}"/>
</target>

<target name="testJSharpc" depends="probe_for_apps" if="jsharp.found">
<property name="testJSharp.exe"
location="${dest.dir}/jsharp.exe" />
<au:assertFileDoesntExist file="${testJSharp.exe}"/>
<dn:jsharpc
destFile="${testJSharp.exe}"
targetType="exe"
>
<src dir="${source.dir}" includes="*.java"/>
</dn:jsharpc>
<au:assertFileExists file="${testJSharp.exe}"/>
</target>

<target name="testVBC" depends="probe_for_apps" if="vbc.found">
<property name="testVBC.exe"
location="${dest.dir}/ExampleVbc.exe" />
<au:assertFileDoesntExist file="${testVBC.exe}"/>
<dn:vbc
destFile="${testVBC.exe}"
targetType="exe"
srcDir="${source.dir}"
>
</dn:vbc>
<au:assertFileExists file="${testVBC.exe}"/>
</target>

<target name="testIlasm" depends="probe_for_apps" if="ilasm.found">
<property name="testIlasm.exe"
location="${dest.dir}/ilasm.exe" />
<au:assertFileDoesntExist file="${testIlasm.exe}"/>
<dn:ilasm
destFile="${testIlasm.exe}"
targetType="exe"
>
<src dir="${source.dir}" includes="*.il"/>
</dn:ilasm>
<au:assertFileExists file="${testIlasm.exe}"/>
</target>

</project>
@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="compilation in dir with spaces" basedir="." default="echo"
xmlns:au="antlib:org.apache.ant.antunit"
xmlns:dn="antlib:org.apache.ant.dotnet">

<property name="source.dir" location="src"/>
<property name="dest.dir" location="dest"/>

<target name="probe_for_apps" >
<property environment="env"/>

<condition property="wsdl.found">
<or>
<available file="wsdl.exe" filepath="${env.Path}" />
<available file="wsdl" filepath="${env.PATH}" />
<available file="wsdl.exe" filepath="${env.PATH}" />
</or>
</condition>

</target>

<target name="setUp">
<mkdir dir="${source.dir}"/>
<mkdir dir="${dest.dir}"/>
<copy todir="${source.dir}">
<fileset dir="../wsdl"/>
</copy>
</target>

<target name="tearDown">
<delete dir="${source.dir}"/>
<delete dir="${dest.dir}"/>
</target>

<target name="testWSDL" depends="probe_for_apps" if="wsdl.found">
<property name="testWSDL.in"
location="${source.dir}/StockQuoteService.wsdl" />
<property name="testWSDL.out"
location="${dest.dir}/StockQuoteService.cs" />
<au:assertFileDoesntExist file="${testWSDL.out}"/>
<dn:wsdltodotnet
destFile="${testWSDL.out}"
srcFile="${testWSDL.in}"
>
</dn:wsdltodotnet>
<au:assertFileExists file="${testWSDL.out}"/>
</target>
</project>
@@ -0,0 +1,22 @@
REM Licensed to the Apache Software Foundation (ASF) under one or more
REM contributor license agreements. See the NOTICE file distributed with
REM this work for additional information regarding copyright ownership.
REM The ASF licenses this file to You under the Apache License, Version 2.0
REM (the "License"); you may not use this file except in compliance with
REM the License. You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.

Imports System

Class Example
Shared Sub Main()
Console.WriteLine("This is VB.NET")
End Sub
End Class

0 comments on commit feebaef

Please sign in to comment.