| <?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="nant" basedir="." default="echo" |
| xmlns:au="antlib:org.apache.ant.antunit" |
| xmlns:dn="antlib:org.apache.ant.dotnet"> |
| |
| <import file="../augment-path.xml"/> |
| |
| <target name="setUp"> |
| <condition property="nant.found"> |
| <or> |
| <available file="NAnt.exe" filepath="${augmented.PATH}"/> |
| <available file="NAnt.exe"/> |
| </or> |
| </condition> |
| </target> |
| |
| <target name="test-echo" if="nant.found"> |
| <dn:nant |
| buildfile="src/nant.build" |
| > |
| <dn:target name="echo"/> |
| <dn:property name="foo" value="bar"/> |
| </dn:nant> |
| <au:assertLogContains text="foo is bar"/> |
| </target> |
| |
| <target name="test-nested-file" if="nant.found"> |
| <property name="foo" value="baz"/> |
| <dn:nant> |
| <dn:build> |
| <project basedir="." default="echo"> |
| <target name="echo"> |
| <echo message="foo is ${foo}"/> |
| </target> |
| </project> |
| </dn:build> |
| </dn:nant> |
| <au:assertLogContains text="foo is baz"/> |
| </target> |
| |
| <target name="test-nested-task" if="nant.found"> |
| <property name="foo2" value="xyzzy"/> |
| <dn:nant errorProperty="nant.failed1"> |
| <dn:build> |
| <echo message="foo is ${foo2}"/> |
| </dn:build> |
| </dn:nant> |
| <au:assertLogContains text="foo is xyzzy"/> |
| <au:assertFalse message="no failure"> |
| <isset property="nant.failed1"/> |
| </au:assertFalse> |
| </target> |
| |
| <target name="test-fail" if="nant.found"> |
| <au:expectfailure message="NAnt should fail"> |
| <dn:nant> |
| <dn:build> |
| <fail message="Failed"/> |
| </dn:build> |
| </dn:nant> |
| </au:expectfailure> |
| </target> |
| |
| <target name="test-hidden-failure" if="nant.found"> |
| <dn:nant failOnError="false"> |
| <dn:build> |
| <fail message="Failed"/> |
| </dn:build> |
| </dn:nant> |
| </target> |
| |
| <target name="test-hidden-failure-property" if="nant.found"> |
| <dn:nant failOnError="false" errorProperty="nant.failed"> |
| <dn:build> |
| <fail message="Failed"/> |
| </dn:build> |
| </dn:nant> |
| <au:assertPropertySet name="nant.failed"/> |
| </target> |
| </project> |