> > OK whats happening is that we pass a config file to our test
assemblies.
> > This config file will have the default set to 1.0 causing problems
when
> > the test initialises.
> > There is currently no easy way of passing the -k value thru to the
tests
> > as they are standalone test assemblies that could  be run from the
> > NUnitConsole rather than the NUnit task.
> >
> > I've written a quick hack to generate a new config file in the temp
> > folder with the default framework set to what was passed in -k, and
then
> > passes that config to the tests. This works but its not the 'right'
> > solution because its in the NUnitTask.cs and will try and run for
every
> > test  task - not just the tests for nant.
> 
> I don't think we'd want that ...

It might, however, explain/fix the NUnit2 task problem that I have with
tests that rely upon config files.  The tests that expect
Some.Assembly.Name.dll.config to be adjacent to the assembly fail
because the 1.0 Framework is unavailable on my build machine.  If I run
the NUnit-Console or NUnit-GUI against the assembly directly, it works
just fine.

NAnt.exe.config already has the 1.1 default and proper ordering of the
supportedRuntimes...  :\  Something's preventing proper loading of the
config file due to some M$ change in the XML namespaces.

Here's an example test that fails under NAnt that runs fine using
NUnit-Console directly.  It seems to fail because the config file is not
loaded (leaving the connection strings and other values null).  I wrote
this little stub test for this demonstration:

[Test()]
public void TestConfig()
{
        Assertion.AssertEquals( "These must match.",
                ConfigurationSettings.AppSettings["Config Test"],
                "Nunya" );
}

// NAnt runs.
unittests:

     [echo] Run the unit tests.
   [nunit2] Tests run: 9, Failures: 1, Not run: 0, Time: 0.1301924
seconds

Failures:
1)
eRealty.Desktop.AppointmentCalendar.TestCalendarUserControl.TestConfig :
Thes
e must match.
expected:<(null)>
 but was:<Nunya>
   at
eRealty.Desktop.AppointmentCalendar.TestCalendarUserControl.TestConfig()
i
n c:\build\desktop\appointmentcalendar\Calendar.ascx.cs:line 48

Total time: 8 seconds.

BUILD FAILED

Tests Failed

// NUnit-Console runs.
C:\build>"C:\Program Files\NUnit V2.0\bin\nunit-console"
/assembly:desktop\bin\e
realty.desktop.appointmentcalendar.dll
NUnit version 2.0.6
Copyright (C) 2002 James W. Newkirk, Michael C. Two, Alexei A.
Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
..N.N.N.N.N.N........

Tests run: 9, Failures: 0, Not run: 0, Time: 0.1902812 seconds



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to