Browse Source

Update to NUnit 2.6.0.12051

pull/6/merge
Matt Ward 14 years ago
parent
commit
95aeaba095
  1. BIN
      src/Tools/NUnit/lib/nunit-console-runner.dll
  2. BIN
      src/Tools/NUnit/lib/nunit-gui-runner.dll
  3. BIN
      src/Tools/NUnit/lib/nunit.core.dll
  4. BIN
      src/Tools/NUnit/lib/nunit.core.interfaces.dll
  5. BIN
      src/Tools/NUnit/lib/nunit.uiexception.dll
  6. BIN
      src/Tools/NUnit/lib/nunit.uikit.dll
  7. BIN
      src/Tools/NUnit/lib/nunit.util.dll
  8. 4
      src/Tools/NUnit/license.txt
  9. BIN
      src/Tools/NUnit/nunit-console-dotnet2-x86.exe
  10. 72
      src/Tools/NUnit/nunit-console-dotnet2-x86.exe.config
  11. BIN
      src/Tools/NUnit/nunit-console-dotnet2.exe
  12. 72
      src/Tools/NUnit/nunit-console-dotnet2.exe.config
  13. BIN
      src/Tools/NUnit/nunit-console-x86.exe
  14. 84
      src/Tools/NUnit/nunit-console-x86.exe.config
  15. BIN
      src/Tools/NUnit/nunit-console.exe
  16. 77
      src/Tools/NUnit/nunit-console.exe.config
  17. 6
      src/Tools/NUnit/nunit-console/AssemblyInfo.cs
  18. 161
      src/Tools/NUnit/nunit-console/ExtendedConsoleUi.cs
  19. 2
      src/Tools/NUnit/nunit-console/nunit-console.csproj
  20. BIN
      src/Tools/NUnit/nunit.framework.dll

BIN
src/Tools/NUnit/lib/nunit-console-runner.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit-gui-runner.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit.core.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit.core.interfaces.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit.uiexception.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit.uikit.dll

Binary file not shown.

BIN
src/Tools/NUnit/lib/nunit.util.dll

Binary file not shown.

4
src/Tools/NUnit/license.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
Copyright © 2002-2008 Charlie Poole
Copyright © 2002-2012 Charlie Poole
Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
Copyright © 2000-2002 Philip A. Craig
@ -8,7 +8,7 @@ Permission is granted to anyone to use this software for any purpose, including @@ -8,7 +8,7 @@ Permission is granted to anyone to use this software for any purpose, including
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
Portions Copyright © 2002-2008 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
Portions Copyright © 2002-2012 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

BIN
src/Tools/NUnit/nunit-console-dotnet2-x86.exe

Binary file not shown.

72
src/Tools/NUnit/nunit-console-dotnet2-x86.exe.config

@ -1,69 +1,31 @@ @@ -1,69 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
The .NET 2.0 build of the console runner only
runs under .NET 2.0 or higher. The setting
useLegacyV2RuntimeActivationPolicy only applies
under .NET 4.0 and permits use of mixed mode
assemblies, which would otherwise not load
correctly.
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<supportedRuntime version="v2.0.50727" />
<!-- <supportedRuntime version="v4.0.30319" /> -->
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<!-- Ensure that test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
<loadFromRemoteSources enabled="true" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
<!--
The following <assemblyBinding> section allows running nunit under
.NET 1.0 by redirecting assemblies. The appliesTo attribute
causes the section to be ignored except under .NET 1.0
on a machine with only the .NET version 1.0 runtime installed.
If application and its tests were built for .NET 1.1 you will
also need to redirect system assemblies in the test config file,
which controls loading of the tests.
-->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="System"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Windows.Forms"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

BIN
src/Tools/NUnit/nunit-console-dotnet2.exe

Binary file not shown.

72
src/Tools/NUnit/nunit-console-dotnet2.exe.config

@ -1,69 +1,31 @@ @@ -1,69 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
The .NET 2.0 build of the console runner only
runs under .NET 2.0 or higher. The setting
useLegacyV2RuntimeActivationPolicy only applies
under .NET 4.0 and permits use of mixed mode
assemblies, which would otherwise not load
correctly.
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<supportedRuntime version="v2.0.50727" />
<!-- <supportedRuntime version="v4.0.30319" /> -->
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<!-- Ensure that test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
<loadFromRemoteSources enabled="true" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
<!--
The following <assemblyBinding> section allows running nunit under
.NET 1.0 by redirecting assemblies. The appliesTo attribute
causes the section to be ignored except under .NET 1.0
on a machine with only the .NET version 1.0 runtime installed.
If application and its tests were built for .NET 1.1 you will
also need to redirect system assemblies in the test config file,
which controls loading of the tests.
-->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="System"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Windows.Forms"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

BIN
src/Tools/NUnit/nunit-console-x86.exe

Binary file not shown.

84
src/Tools/NUnit/nunit-console-x86.exe.config

@ -1,79 +1,31 @@ @@ -1,79 +1,31 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<requiredRuntime version="v4.0" />
</startup>
<!-- Set the level for tracing NUnit itself -->
<!-- 0=Off 1=Error 2=Warning 3=Info 4=Debug -->
<system.diagnostics>
<switches>
<add name="NTrace" value="0" />
</switches>
</system.diagnostics>
<!--
The .NET 2.0 build of the console runner only
runs under .NET 2.0 or higher. The setting
useLegacyV2RuntimeActivationPolicy only applies
under .NET 4.0 and permits use of mixed mode
assemblies, which would otherwise not load
correctly.
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<!-- <supportedRuntime version="v2.0.50727" /> -->
<supportedRuntime version="v4.0.30319" />
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<!-- Ensure that test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
<loadFromRemoteSources enabled="true" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
<!--
The following <assemblyBinding> section allows running nunit under
.NET 1.0 by redirecting assemblies. The appliesTo attribute
causes the section to be ignored except under .NET 1.0
on a machine with only the .NET version 1.0 runtime installed.
If application and its tests were built for .NET 1.1 you will
also need to redirect system assemblies in the test config file,
which controls loading of the tests.
-->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="System"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Windows.Forms"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

BIN
src/Tools/NUnit/nunit-console.exe

Binary file not shown.

77
src/Tools/NUnit/nunit-console.exe.config

@ -1,72 +1,31 @@ @@ -1,72 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<requiredRuntime version="v4.0" />
</startup>
<!--
The .NET 2.0 build of the console runner only
runs under .NET 2.0 or higher. The setting
useLegacyV2RuntimeActivationPolicy only applies
under .NET 4.0 and permits use of mixed mode
assemblies, which would otherwise not load
correctly.
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<!-- <supportedRuntime version="v2.0.50727" /> -->
<supportedRuntime version="v4.0.30319" />
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<!-- Ensure that test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
<loadFromRemoteSources enabled="true" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
<!--
The following <assemblyBinding> section allows running nunit under
.NET 1.0 by redirecting assemblies. The appliesTo attribute
causes the section to be ignored except under .NET 1.0
on a machine with only the .NET version 1.0 runtime installed.
If application and its tests were built for .NET 1.1 you will
also need to redirect system assemblies in the test config file,
which controls loading of the tests.
-->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
appliesTo="v1.0.3705">
<dependentAssembly>
<assemblyIdentity name="System"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Drawing"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Windows.Forms"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Xml"
publicKeyToken="b77a5c561934e089"
culture="neutral"/>
<bindingRedirect oldVersion="1.0.5000.0"
newVersion="1.0.3300.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

6
src/Tools/NUnit/nunit-console/AssemblyInfo.cs

@ -16,7 +16,7 @@ using System.Reflection; @@ -16,7 +16,7 @@ using System.Reflection;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("NUnit.org")]
[assembly: AssemblyProduct("NUnit")]
[assembly: AssemblyCopyright("Copyright (C) 2002-2010 Charlie Poole.\r\n" +
[assembly: AssemblyCopyright("Copyright (C) 2002-2012 Charlie Poole.\r\n" +
"Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.\r\n" +
"Copyright (C) 2000-2002 Philip Craig.\r\n" +
"Copyright (C) 2006 Daniel Grunwald.\r\n" +
@ -36,5 +36,5 @@ using System.Reflection; @@ -36,5 +36,5 @@ using System.Reflection;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.5.10")]
[assembly: AssemblyInformationalVersion("2.5.10")]
[assembly: AssemblyVersion("2.6.0")]
[assembly: AssemblyInformationalVersion("2.6.0")]

161
src/Tools/NUnit/nunit-console/ExtendedConsoleUi.cs

@ -4,9 +4,6 @@ @@ -4,9 +4,6 @@
// copyright ownership at http://nunit.org.
// ****************************************************************
// This version of NUnit-console is modified to support:
// 1) Writing all tests results to a file as the test results are known.
namespace NUnit.ConsoleRunner
{
using System;
@ -30,17 +27,29 @@ namespace NUnit.ConsoleRunner @@ -30,17 +27,29 @@ namespace NUnit.ConsoleRunner
public static readonly int FIXTURE_NOT_FOUND = -3;
public static readonly int UNEXPECTED_ERROR = -100;
private string workDir;
public ExtendedConsoleUi()
{
}
public int Execute( ExtendedConsoleOptions options )
{
this.workDir = options.work;
if (workDir == null || workDir == string.Empty)
workDir = Environment.CurrentDirectory;
else
{
workDir = Path.GetFullPath(workDir);
if (!Directory.Exists(workDir))
Directory.CreateDirectory(workDir);
}
TextWriter outWriter = Console.Out;
bool redirectOutput = options.output != null && options.output != string.Empty;
if ( redirectOutput )
{
StreamWriter outStreamWriter = new StreamWriter( options.output );
StreamWriter outStreamWriter = new StreamWriter( Path.Combine(workDir, options.output) );
outStreamWriter.AutoFlush = true;
outWriter = outStreamWriter;
}
@ -49,38 +58,50 @@ namespace NUnit.ConsoleRunner @@ -49,38 +58,50 @@ namespace NUnit.ConsoleRunner
bool redirectError = options.err != null && options.err != string.Empty;
if ( redirectError )
{
StreamWriter errorStreamWriter = new StreamWriter( options.err );
StreamWriter errorStreamWriter = new StreamWriter( Path.Combine(workDir, options.err) );
errorStreamWriter.AutoFlush = true;
errorWriter = errorStreamWriter;
}
TextWriter testResultWriter = null;
if ( options.IsResults )
{
testResultWriter = new StreamWriter ( options.results, false, Encoding.UTF8 );
((StreamWriter)testResultWriter).AutoFlush = true;
}
TestPackage package = MakeTestPackage(options);
Console.WriteLine("ProcessModel: {0} DomainUsage: {1}",
package.Settings.Contains("ProcessModel")
? package.Settings["ProcessModel"]
: "Default",
package.Settings.Contains("DomainUsage")
? package.Settings["DomainUsage"]
: "Default");
ProcessModel processModel = package.Settings.Contains("ProcessModel")
? (ProcessModel)package.Settings["ProcessModel"]
: ProcessModel.Default;
DomainUsage domainUsage = package.Settings.Contains("DomainUsage")
? (DomainUsage)package.Settings["DomainUsage"]
: DomainUsage.Default;
RuntimeFramework framework = package.Settings.Contains("RuntimeFramework")
? (RuntimeFramework)package.Settings["RuntimeFramework"]
: RuntimeFramework.CurrentFramework;
Console.WriteLine("Execution Runtime: {0}",
package.Settings.Contains("RuntimeFramework")
? package.Settings["RuntimeFramework"]
: "Default");
#if CLR_2_0 || CLR_4_0
Console.WriteLine("ProcessModel: {0} DomainUsage: {1}", processModel, domainUsage);
using (TestRunner testRunner = new DefaultTestRunnerFactory().MakeTestRunner(package))
Console.WriteLine("Execution Runtime: {0}", framework);
#else
Console.WriteLine("DomainUsage: {0}", domainUsage);
if (processModel != ProcessModel.Default && processModel != ProcessModel.Single)
Console.WriteLine("Warning: Ignoring project setting 'processModel={0}'", processModel);
if (!RuntimeFramework.CurrentFramework.Supports(framework))
Console.WriteLine("Warning: Ignoring project setting 'runtimeFramework={0}'", framework);
#endif
using (TestRunner testRunner = new DefaultTestRunnerFactory().MakeTestRunner(package))
{
testRunner.Load(package);
testRunner.Load(package);
if (testRunner.Test == null)
if (testRunner.Test == null)
{
testRunner.Unload();
Console.Error.WriteLine("Unable to locate fixture {0}", options.fixture);
@ -90,17 +111,40 @@ namespace NUnit.ConsoleRunner @@ -90,17 +111,40 @@ namespace NUnit.ConsoleRunner
ExtendedEventCollector collector = new ExtendedEventCollector( options, outWriter, errorWriter, testResultWriter );
TestFilter testFilter = TestFilter.Empty;
SimpleNameFilter nameFilter = new SimpleNameFilter();
if ( options.run != null && options.run != string.Empty )
{
Console.WriteLine( "Selected test(s): " + options.run );
testFilter = new SimpleNameFilter( TestNameParser.Parse(options.run) );
foreach (string name in TestNameParser.Parse(options.run))
nameFilter.Add(name);
testFilter = nameFilter;
}
if (options.runlist != null && options.runlist != string.Empty)
{
Console.WriteLine("Run list: " + options.runlist);
using (StreamReader rdr = new StreamReader(options.runlist))
{
// NOTE: We can't use rdr.EndOfStream because it's
// not present in .NET 1.x.
string line = rdr.ReadLine();
while (line != null)
{
if (line[0] != '#')
nameFilter.Add(line);
line = rdr.ReadLine();
}
}
testFilter = nameFilter;
}
if ( options.include != null && options.include != string.Empty )
{
Console.WriteLine( "Included categories: " + options.include );
TestFilter includeFilter = new CategoryExpression( options.include ).Filter;
if ( testFilter.IsEmpty )
Console.WriteLine("Included categories: " + includeFilter.ToString());
if (testFilter.IsEmpty)
testFilter = includeFilter;
else
testFilter = new AndFilter( testFilter, includeFilter );
@ -108,8 +152,9 @@ namespace NUnit.ConsoleRunner @@ -108,8 +152,9 @@ namespace NUnit.ConsoleRunner
if ( options.exclude != null && options.exclude != string.Empty )
{
Console.WriteLine( "Excluded categories: " + options.exclude );
TestFilter excludeFilter = new NotFilter( new CategoryExpression( options.exclude ).Filter );
Console.WriteLine("Excluded categories: " + excludeFilter.ToString());
if ( testFilter.IsEmpty )
testFilter = excludeFilter;
else if ( testFilter is AndFilter )
@ -118,9 +163,9 @@ namespace NUnit.ConsoleRunner @@ -118,9 +163,9 @@ namespace NUnit.ConsoleRunner
testFilter = new AndFilter( testFilter, excludeFilter );
}
if (testFilter is NotFilter)
((NotFilter)testFilter).TopLevel = true;
if (testFilter is NotFilter)
((NotFilter)testFilter).TopLevel = true;
TestResult result = null;
string savedDirectory = Environment.CurrentDirectory;
TextWriter savedOut = Console.Out;
@ -128,7 +173,7 @@ namespace NUnit.ConsoleRunner @@ -128,7 +173,7 @@ namespace NUnit.ConsoleRunner
try
{
result = testRunner.Run( collector, testFilter );
result = testRunner.Run( collector, testFilter, false, LoggingThreshold.Off );
}
finally
{
@ -164,22 +209,31 @@ namespace NUnit.ConsoleRunner @@ -164,22 +209,31 @@ namespace NUnit.ConsoleRunner
{
WriteSummaryReport(summary);
if (summary.ErrorsAndFailures > 0 || result.IsError || result.IsFailure)
{
if (options.stoponerror)
{
Console.WriteLine("Test run was stopped after first error, as requested.");
Console.WriteLine();
}
WriteErrorsAndFailuresReport(result);
}
if (summary.TestsNotRun > 0)
WriteNotRunReport(result);
}
// Write xml output here
string xmlResultFile = options.xml == null || options.xml == string.Empty
? "TestResult.xml" : options.xml;
if (!String.IsNullOrEmpty(options.xml))
{
using (StreamWriter writer = new StreamWriter(xmlResultFile))
{
writer.Write(xmlOutput);
}
if (!options.noresult)
{
// Write xml output here
string xmlResultFile = options.result == null || options.result == string.Empty
? "TestResult.xml" : options.result;
using (StreamWriter writer = new StreamWriter(Path.Combine(workDir, xmlResultFile)))
{
writer.Write(xmlOutput);
}
}
}
returnCode = summary.ErrorsAndFailures;
}
@ -194,9 +248,9 @@ namespace NUnit.ConsoleRunner @@ -194,9 +248,9 @@ namespace NUnit.ConsoleRunner
}
#region Helper Methods
// TODO: See if this can be unified with the Gui's MakeTestPackage
private static TestPackage MakeTestPackage( ConsoleOptions options )
{
// TODO: See if this can be unified with the Gui's MakeTestPackage
private TestPackage MakeTestPackage( ConsoleOptions options )
{
TestPackage package;
DomainUsage domainUsage = DomainUsage.Default;
ProcessModel processModel = ProcessModel.Default;
@ -205,7 +259,7 @@ namespace NUnit.ConsoleRunner @@ -205,7 +259,7 @@ namespace NUnit.ConsoleRunner
string[] parameters = new string[options.ParameterCount];
for (int i = 0; i < options.ParameterCount; i++)
parameters[i] = Path.GetFullPath((string)options.Parameters[i]);
if (options.IsTestProject)
{
NUnitProject project =
@ -222,26 +276,28 @@ namespace NUnit.ConsoleRunner @@ -222,26 +276,28 @@ namespace NUnit.ConsoleRunner
}
else if (parameters.Length == 1)
{
package = new TestPackage(parameters[0]);
package = new TestPackage(parameters[0]);
domainUsage = DomainUsage.Single;
}
else
{
// TODO: Figure out a better way to handle "anonymous" packages
// TODO: Figure out a better way to handle "anonymous" packages
package = new TestPackage(null, parameters);
package.AutoBinPath = true;
package.AutoBinPath = true;
domainUsage = DomainUsage.Multiple;
}
#if CLR_2_0 || CLR_4_0
if (options.framework != null)
framework = RuntimeFramework.Parse(options.framework);
if (options.process != ProcessModel.Default)
processModel = options.process;
#endif
if (options.domain != DomainUsage.Default)
domainUsage = options.domain;
if (options.framework != null)
framework = RuntimeFramework.Parse(options.framework);
package.TestName = options.fixture;
package.Settings["ProcessModel"] = processModel;
@ -260,6 +316,11 @@ namespace NUnit.ConsoleRunner @@ -260,6 +316,11 @@ namespace NUnit.ConsoleRunner
package.Settings["ShadowCopyFiles"] = !options.noshadow;
package.Settings["UseThreadedRunner"] = !options.nothread;
package.Settings["DefaultTimeout"] = options.timeout;
package.Settings["WorkDirectory"] = this.workDir;
package.Settings["StopOnError"] = options.stoponerror;
if (options.apartment != System.Threading.ApartmentState.Unknown)
package.Settings["ApartmentState"] = options.apartment;
return package;
}

2
src/Tools/NUnit/nunit-console/nunit-console.csproj

@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\</OutputPath>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG;CLR_2_0,NET_2_0,CS_3_0</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>

BIN
src/Tools/NUnit/nunit.framework.dll

Binary file not shown.
Loading…
Cancel
Save