Thanks Gert.  I must be having some other problem. I d/l the latest version and it compiled right away, but if I try to run nUnit 2.2 (Gui or Console)  I get an Exception.

 

To further test this, I created a VB project and copied the code, compiled and ran tests using nUnit-GUI. All was fine. I then created a build file and ran nAnt, which was successful.

 

The exe runs, but if I try to run the nUnit on the app, here is what I get;
Server stack trace:

   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)

   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)

   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark)

   at System.AppDomain.Load(String assemblyString)

   at NUnit.Core.TestSuiteBuilder.Load(String assemblyName)

   at NUnit.Core.TestSuiteBuilder.Build(String assemblyName, Int32 assemblyKey)

   at NUnit.Core.RemoteTestRunner.Load(String assemblyName)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBase mb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

 

Exception rethrown at [0]:

   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

   at NUnit.Core.TestRunner.Load(String assemblyName)

   at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture)

   at NUnit.Util.TestDomain.Load(NUnitProject project, String testFixture)

   at NUnit.Util.TestLoader.LoadTest(String testName)

 

Larry Richardson

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gert Driesen
Sent: Thursday, April 14, 2005 1:07 AM
To: 'Larry Richardson'; [email protected]
Subject: RE: [Nant-users] Integrating nUnit in nAnt build

 

Hi Larry,

 

You can use the <nunit2> task for this purpose:

 

http://nant.sourceforge.net/release/latest/help/tasks/nunit2.html

 

Hope this helps,

 

Gert

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Richardson
Sent: donderdag 14 april 2005 5:16
To: [email protected]
Subject: [Nant-users] Integrating nUnit in nAnt build

First of all, newbie to the automated build tools, so this might be a easy question.

 

I have a simple HelloWorld program that I added nUnit test to. When I try to run nAnt, it says “Nunit.Framework cannot be found”. The dlls are in the build directory.

 

Thanks in advance..

Larry

 

Imports System

Imports NUnit.Framework

 

Public Class MainApp

    Shared Sub Main()

        Console.WriteLine("Hello World using VB.NET version 7")

        Return

    End Sub

End Class

 

<TestFixture()> _

Public Class SomeClassTests

 

    <Test()> _

    Public Sub TestMain()

         Main()

        Assert.IsTrue(true)

    End Sub

End Class

 

 

And a simple build file :

------------------------------------------------------------------------------------------------

<?xml version="1.0"?>

<project name="Hello World" default="test">

    <property name="basename" value="HelloWorld"/>

    <property name="debug" value="true"/>

    <target name="clean">

        <delete>

            <fileset>

                <includes name="${basename}-??.exe"/>

                <includes name="${basename}-??.pdb"/>

            </fileset>

        </delete>

    </target>

 

    <target name="build">

 

        <vbc target="exe" output="${basename}-vb.exe" debug="${debug}">

            <sources>

                <includes name="${basename}.vb"/>

            </sources>

         <references>

                                   <include name="nunit.framework.dll" />

                     </references>

 

        </vbc>

    </target>

 

    <target name="test" depends="build">

        <exec program="${basename}-vb.exe" basedir="."/>

    </target>

</project>

 

Reply via email to