NAnt test target not working
----------------------------
Key: AMQNET-177
URL: https://issues.apache.org/activemq/browse/AMQNET-177
Project: ActiveMQ .Net
Issue Type: Bug
Components: ActiveMQ Client
Affects Versions: 1.1.0
Reporter: Timothy Bish
Assignee: Jim Gomes
Priority: Minor
Fix For: 1.2.0
The NAnt test target in the nat-common.xml files isn't working. When run from a
Linux box the target fails
The problem is the options passed to the nunit-console:
{noformat}
<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>
{noformat}
According to the NUnit console docs on linux the console only accepts hyphens
for args, and accept both forms on windows, so the target should be changed to:
{noformat}
<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>
{noformat}
Unfortunately it still doesn't run but gives errors along the lines of:
{noformat}
[exec] ** (/usr/lib64/mono/1.0/nunit-console.exe:31465): WARNING **: The
class System.Collections.Generic.Dictionary`2 could not be loaded, used in
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
[exec] Unhandled Exception:
[exec] System.TypeLoadException: Could not load type
'Apache.NMS.Test.NMSTestSupport' from assembly 'Apache.NMS.Test,
Version=1.2.0.1663, Culture=neutral, PublicKeyToken=82756feee3957618'.
[exec]
[exec] Server stack trace:
[exec] at (wrapper managed-to-native) System.MonoType:GetMethodsByName
(string,System.Reflection.BindingFlags,bool,System.Type)
[exec] at System.MonoType.GetMethods (BindingFlags bindingAttr)
[0x00000] in
/builddir/build/BUILD/mono-2.4/mcs/class/corlib/System/MonoType.cs:175
[exec] at NUnit.Core.Reflect.GetMethodWithAttribute (System.Type
fixtureType, System.String attributeName, BindingFlags bindingFlags, Boolean
inherit) [0x00000] in
/builddir/build/BUILD/mono-2.4/mcs/nunit24/NUnitCore/core/Reflect.cs:212
[exec] at NUnit.Core.NUnitFramework.GetFixtureSetUpMethod (System.Type
fixtureType) [0x00000] in
/builddir/build/BUILD/mono-2.4/mcs/nunit24/NUnitCore/core/NUnitFramework.cs:117
[exec] at NUnit.Core.NUnitTestFixture..ctor (System.Type fixtureType)
[0x00000] in /builddir/build/BUILD/mono-2.4/mcs/nunit24/CommonAssemblyInfo.cs:1
[exec] at NUnit.Core.Builders.NUnitTestFixtureBuilder.MakeSuite
(System.Type type) [0x00000] in
/builddir/build/BUILD/mono-2.4/mcs/nunit24/NUnitCore/core/Builders/NUnitTestFixtureBuilder.cs:32
[exec] at NUnit.Core.Builders.AbstractFixtureBuilder.BuildFrom
(System.Type type) [0x00000] in
/builddir/build/BUILD/mono-2.4/mcs/nunit24/NUnitCore/core/Builders/AbstractFixtureBuilder.cs:69
{noformat}
You get different errors on Windows when you run this but they boil down to the
same problem, the nunit-console command is running a 1.1 CLR which isn't right,
it should be calling nunit-console2 which runs a 2.0 CLR. Once you make that
change then things start to work a bit better. The tests still fail because it
seems that the tests aren't running from the working directory specified so the
NMSTestSupport functions can't load the test config file, but at it gets to the
point where its actually running the tests.
Anyone know how to get the nunit-console execution to run in the right working
directory?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.