Add test NAnt target.
Fixes [AMQNET-125]. (See https://issues.apache.org/activemq/browse/AMQNET-125)
diff --git a/Apache.NMS.MSMQ.Test.nunit b/Apache.NMS.MSMQ.Test.nunit
new file mode 100644
index 0000000..3b29e26
--- /dev/null
+++ b/Apache.NMS.MSMQ.Test.nunit
@@ -0,0 +1,7 @@
+<NUnitProject>
+ <Settings activeconfig="Default" />
+ <Config name="Default" binpathtype="Auto">
+ <assembly path="Apache.NMS.MSMQ.Test.dll" />
+ <assembly path="Apache.NMS.Test.dll" />
+ </Config>
+</NUnitProject>
\ No newline at end of file
diff --git a/nant-common.xml b/nant-common.xml
index 92fee97..f254c35 100644
--- a/nant-common.xml
+++ b/nant-common.xml
@@ -463,6 +463,36 @@
</target>
<!-- ============================================================================================ -->
+ <!-- T E S T T A R G E T S -->
+ <!-- ============================================================================================ -->
+
+ <target name="test" depends="test-debug" description="Alias test target to test-debug"/>
+ <target name="test-all" depends="test-debug, test-release" description="Test all build configurations for all runtime configurations"/>
+
+ <target name="test-debug" depends="" description="Test debug build configurations for all runtime configurations">
+ <property name="current.build.config" value="debug"/>
+ <call target="test-frameworks" />
+ </target>
+
+ <target name="test-release" depends="" description="Test release build configurations for all runtime configurations">
+ <property name="current.build.config" value="release"/>
+ <call target="test-frameworks" />
+ </target>
+
+ <target name="test-frameworks">
+ <foreach item="String" in="${build.framework.strings}" delim="," property="current.build.framework">
+ <call target="init" />
+ <if test="${not build.skip}">
+ <exec program="nunit-console" failonerror="true" workingdir="build/${current.build.framework}/${current.build.config}">
+ <arg value="${NUnit.Projectfile}"/>
+ <arg value="/labels"/>
+ <arg value="/xml=Nunit.TestOutput.xml"/>
+ </exec>
+ </if>
+ </foreach>
+ </target>
+
+ <!-- ============================================================================================ -->
<!-- M I S C E L L A N E O U S T A R G E T S -->
<!-- ============================================================================================ -->
diff --git a/nant.build b/nant.build
index 9dd9267..ccb3b9e 100644
--- a/nant.build
+++ b/nant.build
@@ -35,6 +35,8 @@
<property name="Apache.NMS.Test.dll" value="${basedir}/lib/Apache.NMS/${current.build.framework}//Apache.NMS.Test.dll" dynamic="true"/>
<property name="Apache.NMS.Test.pdb" value="${basedir}/lib/Apache.NMS/${current.build.framework}/Apache.NMS.Test.pdb" dynamic="true"/>
+ <property name="NUnit.Projectfile" value="${basedir}/Apache.NMS.MSMQ.Test.nunit"/>
+
<!-- Skip certain frameworks, since MSMQ is not supported on those platforms. -->
<property name="build.netcf-2.0.skip" value="true"/>
<property name="build.mono-2.0.skip" value="true"/>
@@ -96,6 +98,7 @@
<include name="${Apache.NMS.Test.pdb}"/>
<include name="${nunit.dll}"/>
<include name="${nunit.extensions.dll}"/>
+ <include name="${NUnit.Projectfile}"/>
</fileset>
<fileset id="install.filenames">