Bruce,

I don't modify the configuration file - so I can't help you there.

Here is the code that I use:

<target name="UnitTest" depends="Build" description="Execute unit tests
using NUnit" >
    <foreach item="File" property="filename">
        <in>
            <items>
                <include
name="${RootDir.Solution}\**\bin\**\*.UnitTests.dll" />
            </items>
        </in>
        <do>
            <echo message="Executing unit tests in '${filename}'" />
            <nunit2>
                <formatter type = "Xml" extension=".xml" usefile="true"
outputdir="${RootDir.Builds}\Tests" />
                <test assemblyname="${filename}" fork="false" />
            </nunit2>
        </do>
    </foreach>
</target>

for each unit test assembly, I run Nunit and have the output written to an
xml file in the Tests directory

I hope this helps.

Noel

 -----Original Message-----
From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]  On Behalf Of Bruce
Leggett
Sent:   Thursday, July 08, 2004 6:15 AM
To:     Nant-Developer List
Subject:        [nant-dev] NUnit2 Task - How do I get this task to work?

To all NAnt developers and users,

I'm trying to use the NUnit2 task to test VB.NET code during my build. I've
tried several different routes to get the task to work with no success. I
don't really understand the documentation when it sais, "you must add the
following node to your test config file". Does that mean your .nunit file?
The code to add is as follows:

<configuration>
    ...
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="nunit.framework"
publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
                <bindingRedirect oldVersion="2.0.6.0" newVersion="2.1.4.0"
/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
    ...
</configuration>


I tried adding that without the "..." characters in my .nunit file. See
below:

<NUnitProject>
  <Settings activeconfig="Debug" />
  <Config name="Debug" binpathtype="Auto">
    <assembly path="ProjectName.Subject.dll" />
  </Config>
  <Config name="Release" binpathtype="Auto">
    <assembly path="ProjectName.Subject.dll" />
  </Config>
  <configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="nunit.framework"
publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
                <bindingRedirect oldVersion="2.0.6.0" newVersion="2.1.4.0"
/>
            </dependentAssembly>
        </assemblyBinding>
          </runtime>
        </configuration>

</NUnitProject>

This is how I set up my NUnit2 task: (The .nunit file is in the output
directory)

<nunit2 verbose="true">
        <formatter type="Xml" />
        <test>
                <assemblies>
                        <includesfile 
name="${staging.output}\ProjectName.Subject.nunit" />
                </assemblies>
        </test>
</nunit2>

I've also tried using the assemblies (dll) files. But I get errors both
ways.  Here is the error, in brief, that I get using the method above:

<task name="nunit2" />
  </target>
     <failure>
        <internalerror>
           <type>System.ArgumentException</type>
              <message>
                   <![CDATA[ Illegal characters in path.  ]]>
              </message>
           <stacktrace>
                <![CDATA[
                     at System.IO.Path.GetFileName(String path)
                     at NAnt.NUnit2.Types.NUnit2Test.get_TestAssemblies()


Someone please tell me what I'm doing wrong. I appreciate any help or hints.

Thank You,
Bruce Leggett




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to