Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
GH-407: Upgrade to NUnit 3
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Jun 3, 2017
1 parent 09759a7 commit 1415774
Show file tree
Hide file tree
Showing 64 changed files with 1,860 additions and 566 deletions.
1,343 changes: 1,343 additions & 0 deletions Externals/NUnit/CHANGES.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Externals/NUnit/NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NUnit 3.0 is based on earlier versions of NUnit, with Portions

Copyright (c) 2002-2014 Charlie Poole or
Copyright (c) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or
Copyright (c) 2000-2002 Philip A. Craig
35 changes: 20 additions & 15 deletions Externals/NUnit/license.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
Copyright � 2002-2014 Charlie Poole
Copyright � 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
Copyright � 2000-2002 Philip A. Craig

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

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-2014 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.

3. This notice may not be removed or altered from any source distribution.
Copyright (c) 2017 Charlie Poole

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

3 changes: 1 addition & 2 deletions Samples/MachineLearning/Liblinear (SVMs)/Train.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ static void exit_with_help()



public static Parameters parse_command_line(string[] args,
out string input_file_name, out string model_file_name)
public static Parameters parse_command_line(string[] args, out string input_file_name, out string model_file_name)
{
// default values
var parameters = new Parameters()
Expand Down
3 changes: 2 additions & 1 deletion Sources/Accord.MachineLearning/Ransac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ public TModel Compute(int size, out int[] inliers)
double den = System.Math.Log(pNoOutliers);
if (den == 0)
TrialsNeeded = num == 0 ? 0 : MaxEvaluations;
else TrialsNeeded = (int)(num / den);
else
TrialsNeeded = (int)(num / den);
}

TrialsPerformed++; // Increase the trial counter.
Expand Down
6 changes: 3 additions & 3 deletions Sources/Accord.Math/Random/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static Random Random
return threadRandom;

// No possibility of race condition here since its thread static
if (Generator.threadRandom == null || Generator.threadLastUpdateTicks < Generator.sourceLastUpdateTicks)
if (Generator.threadRandom == null || Generator.threadLastUpdateTicks <= Generator.sourceLastUpdateTicks)
{
Generator.threadSeed = GetRandomSeed();
Generator.threadLastUpdateTicks = Generator.sourceLastUpdateTicks;
Expand Down Expand Up @@ -220,13 +220,13 @@ public static int? Seed
Trace.WriteLine("All threads will be initialized with the same seed: " + value);
Generator.sourceRandom = null;
}
else
else // value.Value > 0
{
Trace.WriteLine("All threads will be initialized with predictable, but random seeds.");
Generator.sourceRandom = new Random(value.Value);
}
}
else
else // value == null
{
Trace.WriteLine("All threads will be initialized with unpredictable random seeds.");
int s = unchecked((int)(13 * Thread.CurrentThread.ManagedThreadId ^ Generator.sourceLastUpdateTicks));
Expand Down
105 changes: 30 additions & 75 deletions Sources/Accord.NET.testrunconfig
Original file line number Diff line number Diff line change
@@ -1,76 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Accord.NET" id="7d88f820-4815-47e4-ad20-ab97ad0bb852" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>This is a default test run configuration for a local test run.</Description>
<Execution>
<TestTypeSpecific>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
<DataCollectors>
<DataCollector uri="datacollector://Microsoft/CodeCoverage/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.CodeCoverage.CoveragePlugIn, Microsoft.VisualStudio.QualityTools.Plugins.CodeCoverage, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CodeCoverage keyFile="Accord.snk" xmlns="">
<Regular>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Audio.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Audio.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Audio.Formats.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Audio.Formats.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Audition.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Audition.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Controls.Audio.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Controls.Audio.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Controls.Imaging.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Controls.Imaging.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Controls.Statistics.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Controls.Statistics.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.DirectSound.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.DirectSound.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Imaging.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Imaging.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.MachineLearning.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.MachineLearning.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Music.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Music.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Neuro.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Neuro.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Statistics.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Statistics.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Wavelets.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Wavelets.pdb" instrumentInPlace="true" />
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Math.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Math.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
<CodeCoverageItem binaryFile="D:\Projects\Accord.NET\Release\Accord.Vision.dll" pdbFile="D:\Projects\Accord.NET\Release\Accord.Vision.instr.pdb" instrumentInPlace="true">
<KeyFile path="D:\Projects\Accord.NET\Sources\Accord.snk" />
</CodeCoverageItem>
</Regular>
</CodeCoverage>
</Configuration>
</DataCollector>
<DataCollector uri="datacollector://microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Test Impact">
</DataCollector>
</DataCollectors>
</AgentRule>
</Execution>
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Accord.NET" id="7d88f820-4815-47e4-ad20-ab97ad0bb852" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>This is a default test run configuration for a local test run.</Description>
<Execution>
<Timeouts testTimeout="600000" />
<TestTypeSpecific>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
<DataCollectors>
<DataCollector uri="datacollector://microsoft/TestImpact/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TestImpactDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Test Impact">
</DataCollector>
</DataCollectors>
</AgentRule>
</Execution>
<Properties />
</TestSettings>
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,42 @@
<RootNamespace>Accord.Tests.Extras.Imaging.Noncommercial</RootNamespace>
<AssemblyName>Accord.Tests.Extras.Imaging.Noncommercial</AssemblyName>
</PropertyGroup>
<Import Project="$(SolutionDir)..\Unit Tests\Accord.Tests.targets" />
<Import Project="$(SolutionDir)..\Unit Tests\Accord.Tests.targets" />
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<OutputPath>$(SolutionDir)..\Debug\Noncommercial</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net35|AnyCPU' ">
<DefineConstants>TRACE;NET35</DefineConstants>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net40|AnyCPU' ">
<DefineConstants>TRACE;NET40</DefineConstants>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45|AnyCPU'">
<DefineConstants>TRACE;NET45</DefineConstants>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46|AnyCPU'">
<DefineConstants>TRACE;NET46</DefineConstants>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net462|AnyCPU' ">
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<OutputPath>$(SolutionDir)..\Debug\Noncommercial</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net35|AnyCPU' ">
<DefineConstants>TRACE;NET35</DefineConstants>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net40|AnyCPU' ">
<DefineConstants>TRACE;NET40</DefineConstants>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45|AnyCPU'">
<DefineConstants>TRACE;NET45</DefineConstants>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46|AnyCPU'">
<DefineConstants>TRACE;NET46</DefineConstants>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net462|AnyCPU' ">
<DefineConstants>TRACE;NET462</DefineConstants>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'mono|AnyCPU'">
<DefineConstants>TRACE;MONO</DefineConstants>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'mono|AnyCPU'">
<DefineConstants>TRACE;MONO</DefineConstants>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\..\Externals\NUnit\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Externals\NUnit\bin\net-4.5\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'net462|AnyCPU' ">
<DefineConstants>TRACE;NET462</DefineConstants>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'mono|AnyCPU'">
<DefineConstants>TRACE;MONO</DefineConstants>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\..\Externals\NUnit\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Externals\NUnit\bin\net-4.5\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RootNamespace>Accord.Tests.Extras.Math.Noncommercial</RootNamespace>
<AssemblyName>Accord.Tests.Extras.Math.Noncommercial</AssemblyName>
</PropertyGroup>
<Import Project="$(SolutionDir)..\Unit Tests\Accord.Tests.targets" />
<Import Project="$(SolutionDir)..\Unit Tests\Accord.Tests.targets" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand All @@ -28,12 +28,13 @@
<DefineConstants>TRACE;NET462</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'mono|AnyCPU' ">
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<DefineConstants>TRACE;MONO</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\..\Externals\NUnit\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.7.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Externals\NUnit\bin\net-4.5\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@
<DefineConstants>TRACE;MONO</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\..\Externals\NUnit\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Externals\NUnit\bin\net-4.5\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
Expand Down
Loading

0 comments on commit 1415774

Please sign in to comment.