Hi,

Here's an example of using an NUnit task and building a solution,
hopefully this will shed some light on the problem.

Assumptions
-------------------

Using Nant 0.85.1754 - Should work with any 0.85
Using NUnit 2.2

.Net project structure
-------------------------------

TestApp\TestApp.sln
TestApp\TestApp.TestApp\TestApp.TestApp.csproj
TestApp\TestApp.Core\TestApp.Core.csproj
TestApp\TestApp.Tests\TestApp.Tests.csproj
TestApp\bin\
TestApp\TestApp.build

TestApp.sln - Contains the projects TestApp.TestApp, TestApp.Core and
TestApp.Tests.

TestApp.TestApp - A console application that references classes in TestApp.Core
TestApp.Core - Contains classes used by the console application.
TestApp.Tests - Contains NUnit test fixtures that test the
TestApp.Core classes.  Uses NUnit 2.2.

All projects build to the same TestApp\bin directory.

Build script
----------------

<project name="TestApp" default="build">

  <target name="clean">
    <delete>
      <fileset>
        <includes name="bin\*.dll"/>
        <includes name="bin\*.exe"/>
      </fileset>
    </delete>
  </target>

  <target name="build">
    <solution solutionfile="TestApp.sln" configuration="debug"/>
  </target>

  <target name="test" depends="build">
    <nunit2>
        <formatter type="Plain"/>
        <test assemblyname="bin\TestApp.Tests.dll"/>
    </nunit2>
  </target>
</project>


The "build" target uses the <solution> task to build all the projects
in the solution.

The "test" target runs the NUnit tests in TestApp.Tests.dll.

Nant 0.84
--------------

If you are using Nant 0.84 then you should use NUnit 2.1.4.0.  From my
investigations, Nant 0.84 will not work with NUnit 2.2.

In the example above, the build file will work with Nant 0.84, but the
TestApp.Tests project will need to reference the NUnit 2.1.4.0
assembly.

Rgds,

Matt.


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to