I am trying to compile and run a very simple NUnit test from within Nant, and do not succeed to do so.

I have two-three questions here:

1) Why do I need to include Debian pathes to libs here to find the
   nunit.framework.dll ?? Is there another portable solution ??

2) Why do I need to make a redirection to other Nunit versions, and
   where does this redirection config goes ??

3) Does there exist an XML Schema or RelaxNG schema I can use to verify
   that my XML syntax in the nant build file is OK ??

Any help is very much appreciated ..

Platform:
       GNU/Debian Linux i686  2.6.15 kernel
       Mono 1.1.13.6-3
       Nant 0.84+0.85-rc3-10
       NUnit 2.2.8-1


The test source is:

--- TestNantNUnit.cs ---

namespace TestNantNUnit
{
    using System;
    using NUnit.Framework;

    [TestFixture]
        public class TestNantNUnit
        {
            [Test]
                public void OneEqualsOne()
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("TestNantNUnit::OneEqualsOne");

                int one = 1;
                Assert.AreEqual(one, one, "one equals one");
            }
        }
}

--- TestNantNUnit.cs ---

The Nant config is


--- TestNantNUnit.build ---
<?xml version="1.0"?>

<project name="Nant Nunit Test" default="build" basedir=".">
<description>Investigate nunit.framework.dll loading problem</description>
  <!-- Platform:
       GNU/Debian Linux i686  2.6.15 kernel
       Mono 1.1.13.6-3
       Nant 0.84+0.85-rc3-10
       NUnit 2.2.8-1
  -->


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

  <target name="build" description="Build And Test">
    <csc target="library" output="TestNantNUnit.dll" debug="${debug}">
      <sources>
        <include name="TestNantNUnit.cs"/>
      </sources>

      <references>
        <!-- If I do not include one of these libs, I get the error:

[csc] ../nant-nunit-test/TestNantNUnit.cs(5,11): error CS0246: The type or namespace name `NUnit' could not be found. Are you
             missing a using directive or an assembly reference?


             Is there any other solution to this problem ?
             This is highly non-portable from platform to platform .. -->
        <lib>
          <!-- GNU/Debian Linux -->
          <!-- <include name="/usr/lib/nunit"/> -->
          <!-- <include name="/usr/lib/NAnt/lib/mono/1.0"/> -->
          <include name="/usr/lib/cli/nunit-2.2.6"/>

          <!-- MS Server 2003 -->
          <include name="/Program Files/nant-0.85-rc3/bin/lib/net/2.0"/>
          <include name="/Program Files/YAZ/bib"/>
        </lib>
        <include name="nunit.framework.dll"/>
      </references>
    </csc>

    <nunit2>
      <formatter type="Plain"/>
      <test assemblyname="TestNantNUnit.dll"/>
    </nunit2>

    <!-- getting error:
         [nunit2] Assembly
         "/home/marc/code/talis/nant-nunit-test/TestNantNUnit.dll"
         is using version 2.2.8.0 of the NUnit framework. If any
         problems
         arise, then either rebuild this assembly using version 2.2.0.0
         of
         the NUnit Framework or use a binding redirect from version
         2.2.8.0
         to version 2.2.0.0 of the NUnit Framework.   -->

    <!-- So, according to
       http://nant.sourceforge.net/release/latest/help/tasks/nunit2.html
         I need a re-direction. Where does this configuration go ??
         It can not be here ..
    -->
    <!--
        <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.2.0.0" />
        <bindingRedirect oldVersion="2.1.4.0" newVersion="2.2.0.0" />
        </dependentAssembly>
        </assemblyBinding>
        </runtime>
        </configuration>
    -->

  </target>

  <target name="clean" description="Clean Derived Files">
    <delete file="TestNantNUnit.dll" failonerror="false"/>
  </target>


</project>

--

Marc Cromme, cand. polyt, Ph.D
Senior Developer, Project Manager

Index Data Aps
KĂžbmagergade 43, 2
1150 Copenhagen K.
Denmark

tel: +45 3341 0100
fax: +45 3341 0101

http://www.indexdata.com

INDEX DATA Means Business
for Open Source and Open Standards






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to