← Back to team overview

nunit-core team mailing list archive

[Bug 860558] Re: pnunit-agent can't run a tests from another folder

 

Some background some questions:

Normally, a pnunit test references pnunit.framework.dll, so the assembly
is copied to the bin directory. In this case, you are using pnunit to run
tests that make no use of pnunit, so the problem arises, which does not
come up in the use for which pnunit is intended.

Are you trying to use pnunit to parallelize arbitrary tests, rather than
distributed tests that interact with one another? This is not a recommended
use pattern, since it's not what pnunit is designed to do.

Normally, the NUnit AssemblyResolver is used _only_ to inject files requred
by NUnit which should _not_ be referenced by the user into the test
AppDomain. This is the case for nunit.core.dll and nunit.core.interfaces.dll.

Even so, I'd like to experiment with this problem. I have installed your 
project on my Linux system and placed NUnit 2.6 in the same directory
as your setup. What commands do you issue to run the test?

Charlie

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/860558

Title:
  pnunit-agent can't run a tests from another folder

Status in NUnit V2 Test Framework:
  New

Bug description:
  if the assembly `pnunit.tests.dll` located in another directory then
  the process `pnunit-agent.exe` can not download the file `pnunit-
  agent.exe` as a dll library.

  I recommend the following modification of the file:

  === modify file src/NUnitCore/core/AssemblyResolver.cs
  --- src/NUnitCore/core/AssemblyResolver.cs	2009-02-01 05:16:27 +0000
  +++ src/NUnitCore/core/AssemblyResolver.cs	2011-09-09 09:28:02 +0000
  @@ -9,7 +9,8 @@
    using System;
    using System.IO;
    using System.Reflection;
  -	using System.Collections;
  +	using System.Collections;
  +	using System.Collections.Generic;

    /// <summary>
    /// Class adapted from NUnitAddin for use in handling assemblies that are not
  @@ -92,8 +93,11 @@
      }

      foreach( string dir in _dirs )
  -			{
  -				foreach( string file in Directory.GetFiles( dir, "*.dll" ) )
  +			{
  +				List<string> dllCandidates = new List<string>();
  +				dllCandidates.AddRange(Directory.GetFiles(dir, "*.dll"));
  +				dllCandidates.AddRange(Directory.GetFiles(dir, "*.exe"));
  +				foreach (string file in dllCandidates)
       {
        string fullFile = Path.Combine( dir, file );
                       AssemblyReader rdr = new AssemblyReader(fullFile);

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/860558/+subscriptions


References