Skip to content

Commit

Permalink
Merge pull request #148 from nunit/PrepareHotfixRelease2.1.1
Browse files Browse the repository at this point in the history
Prepare hotfix release2.1.1
  • Loading branch information
OsirisTerje authored Mar 19, 2017
2 parents efef6bd + 3327500 commit de8a118
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 43 deletions.
16 changes: 11 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var configuration = Argument("configuration", "Debug");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "2.1.0";
var version = "2.1.1";
var modifier = "";

var dbgSuffix = configuration == "Debug" ? "-dbg" : "";
Expand All @@ -22,7 +22,7 @@ if (BuildSystem.IsRunningOnAppVeyor)
if (tag.IsTag)
{
packageVersion = tag.Name;
}
}
else
{
var buildNumber = AppVeyor.Environment.Build.Number.ToString("00000");
Expand All @@ -32,6 +32,8 @@ if (BuildSystem.IsRunningOnAppVeyor)
if (branch == "master" && !isPullRequest)
{
packageVersion = version + "-dev-" + buildNumber + dbgSuffix;


}
else
{
Expand All @@ -51,7 +53,8 @@ if (BuildSystem.IsRunningOnAppVeyor)
packageVersion = version + suffix;
}
}

if (packageVersion.Length>20)
packageVersion=packageVersion.Substring(0,20);
AppVeyor.UpdateBuildVersion(packageVersion);
}

Expand All @@ -68,6 +71,8 @@ var PACKAGE_IMAGE_DIR = PACKAGE_DIR + packageName + "/";
var TOOLS_DIR = PROJECT_DIR + "tools/";
var BIN_DIR = PROJECT_DIR + "bin/" + configuration + "/";
var DEMO_BIN_DIR = PROJECT_DIR + "src/NUnitTestDemo/NUnitTestDemo/bin/" + configuration + "/";
var VSIXDIR = PROJECT_DIR+"src/NUnitTestAdapterInstall/bin/"+configuration+"/";
var TEST_BIN_DIR = PROJECT_DIR+"src/NUnitTestAdapterTests/bin/"+configuration+"/";

// Solutions
var ADAPTER_SOLUTION = PROJECT_DIR + "NUnitTestAdapter.sln";
Expand All @@ -77,7 +82,7 @@ var DEMO_SOLUTION = PROJECT_DIR + "src/NUnitTestDemo/NUnitTestDemo.sln";
var NUNIT_CONSOLE = TOOLS_DIR + "NUnit.Runners/tools/nunit-console.exe";

// Test Assemblies
var ADAPTER_TESTS = BIN_DIR + "NUnit.VisualStudio.TestAdapter.Tests.dll";
var ADAPTER_TESTS = TEST_BIN_DIR + "NUnit.VisualStudio.TestAdapter.Tests.dll";
var DEMO_TESTS = DEMO_BIN_DIR + "NUnitTestDemo.dll";

// Custom settings for VSTest
Expand Down Expand Up @@ -229,8 +234,9 @@ Task("PackageVsix")
.IsDependentOn("CreatePackageDir")
.Does(() =>
{
System.Console.WriteLine("Packaging the vsix");
CopyFile(
BIN_DIR + "NUnitTestAdapter.vsix",
VSIXDIR + "NUnitTestAdapter.vsix",
PACKAGE_DIR + packageName + ".vsix");
});

Expand Down
8 changes: 4 additions & 4 deletions nuget/NUnitVisualStudioTestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<projectUrl>http://nunit.org/index.php?p=vsTestAdapter&amp;r=2.6</projectUrl>
<iconUrl>http://nunit.org/nuget/nunit_32x32.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A package including the NUnit TestAdapter for Visual Studio 2012/13/15. With this package you don't need to install the VSIX adapter package, and you don't need to upload the adapter to your TFS server.
<description>The NUnit TestAdapter for Visual Studio 2012/13/15 for NUnit 2. With this package you don't need to install the VSIX adapter package, and you don't need to upload the adapter to your TFS server.
Note that this package ONLY contains the adapter, not the NUnit framework. You must also get the framework, or use the NUnitTestAdapter.WithFramework nuget package.
You only need one such package for a solution.
The package works with Visual Studio >= 2012</description>
<releaseNotes>Support for VS 2017, Misc bug fixes</releaseNotes>
You only need one such package for a solution. The package works with Visual Studio >= 2012</description>
<summary>The NUnit TestAdapter for Visual Studio 2012/13/15 for NUnit 2 and lower</summary>
<releaseNotes>Hotfix for .net framework 3.5 support, and missing pdb crash</releaseNotes>
<copyright>Charlie Poole</copyright>
<language>en-US</language>
<tags>test visualstudio testadapter</tags>
Expand Down
4 changes: 3 additions & 1 deletion src/NUnitTestAdapter/NavigationDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ public NavigationData GetNavigationData(string className, string methodName)
return navigationData ?? NavigationData.Invalid;
#endif
}
static bool DoesPdbFileExist(string filepath) => File.Exists(Path.ChangeExtension(filepath, ".pdb"));

static IDictionary<string, TypeDefinition> CacheTypes(string assemblyPath)
{
var readerParameters = new ReaderParameters() { ReadSymbols = true };
var readsymbols = DoesPdbFileExist(assemblyPath);
var readerParameters = new ReaderParameters() { ReadSymbols = readsymbols };
var module = ModuleDefinition.ReadModule(assemblyPath, readerParameters);

var types = new Dictionary<string, TypeDefinition>();
Expand Down
4 changes: 2 additions & 2 deletions src/NUnitTestAdapter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
[assembly: ComVisible(false)]

[assembly: Guid("c0aad5e4-b486-49bc-b3e8-31e01be6fefe")]
[assembly: AssemblyVersion("2.1.0.7")]
[assembly: AssemblyFileVersion("2.1.0.7")]
[assembly: AssemblyVersion("2.1.1.0")]
[assembly: AssemblyFileVersion("2.1.1.0")]
18 changes: 10 additions & 8 deletions src/NUnitTestAdapterInstall/NUnitTestAdapterInstall.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -41,7 +41,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\Release\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -101,16 +101,18 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net35\Mono.Cecil.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
<Reference Include="Mono.Cecil.Mdb">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net35\Mono.Cecil.Mdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
<Reference Include="Mono.Cecil.Pdb">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net35\Mono.Cecil.Pdb.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Mono.Cecil.0.9.6.4\lib\net35\Mono.Cecil.Rocks.dll</HintPath>
</Reference>
<Reference Include="nunit.core, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
Binary file modified src/NUnitTestAdapterInstall/license.rtf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/NUnitTestAdapterInstall/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VSSDK.BuildTools" version="15.0.26201" targetFramework="net45" developmentDependency="true" />
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />

</packages>
8 changes: 5 additions & 3 deletions src/NUnitTestAdapterInstall/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="NUnitTestAdapterInstall..7c53286e-ac4f-485f-915c-5ec5a4c47b0c" Version="2.1.0.0" Language="en-US" Publisher="Charlie Poole" />
<Identity Id="NUnitTestAdapterInstall..7c53286e-ac4f-485f-915c-5ec5a4c47b0c" Version="2.1.1" Language="en-US" Publisher="Charlie Poole" />
<DisplayName>NUnit 2 Test Adapter</DisplayName>
<Description xml:space="preserve">NUnit 2 adapter for running tests in Visual Studio 2012 and newer. Works with NUnit 2.x, use the NUnit 3 adapter for 3.x tests.</Description>
<Description xml:space="preserve">NUnit 2 adapter for running tests in Visual Studio 2012 and newer. Works with NUnit 2.x, for 3.x tests use the NUnit 3 adapter.</Description>
<MoreInfo>https://github.com/nunit/docs/wiki/VS-Adapter</MoreInfo>
<License>license.rtf</License>
<GettingStartedGuide>https://github.com/nunit/docs/wiki/Usage</GettingStartedGuide>
<ReleaseNotes>https://github.com/nunit/docs/wiki/AdapterV2-Release-Notes</ReleaseNotes>
<Icon>nunit_32x32.png</Icon>
<PreviewImage>preview.png</PreviewImage>
<Tags>test, Testing, adapter, NUNit, TDD, NUnit</Tags>
<Tags>test, Testing, adapter, NUnit, TDD, NUnit</Tags>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[11.0,16.0)" />
Expand Down
2 changes: 1 addition & 1 deletion src/NUnitTestAdapterTests/NUnitEventListenerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class NUnitEventListenerTests
private static readonly string ThisAssemblyPath =
Path.GetFullPath("NUnit.VisualStudio.TestAdapter.Tests.dll");
private static readonly string ThisCodeFile =
Path.GetFullPath(@"..\..\src\NUnitTestAdapterTests\NUnitEventListenerTests.cs");
Path.GetFullPath(@"..\..\NUnitEventListenerTests.cs");

private const int LineNumber = 29; // Must be number of the following line
// ReSharper disable once UnusedMember.Local
Expand Down
4 changes: 2 additions & 2 deletions src/NUnitTestAdapterTests/NUnitTestAdapterTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand All @@ -29,7 +29,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\bin\Release\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
Expand Down
37 changes: 26 additions & 11 deletions src/NUnitTestAdapterTests/ProjectTests.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Tests.Assemblies;

namespace NUnit.VisualStudio.TestAdapter.Tests
{
Expand All @@ -16,39 +13,57 @@ public class ProjectTests
public void ThatTheTestAdapterUsesFrameWork35()
{
var dir = Directory.GetCurrentDirectory();
var assembly = Assembly.LoadFrom(dir+"/NUnit.VisualStudio.TestAdapter.dll");
var assembly = Assembly.LoadFrom(dir + "/NUnit.VisualStudio.TestAdapter.dll");
var version = assembly.ImageRuntimeVersion;
Assert.That(version,Is.EqualTo("v2.0.50727"),"The NUnitTestAdapter project must be set to target .net framework 3.5");
Assert.That(version, Is.EqualTo("v2.0.50727"), "The NUnitTestAdapter project must be set to target .net framework 3.5");
}

[Test]
public void ThatNoMSTestDLLIsCopiedToOutput()
{
var dir = Directory.GetCurrentDirectory();
var filesNotToExist = Directory.EnumerateFiles(dir, "Microsoft", SearchOption.TopDirectoryOnly);
Assert.IsTrue(!filesNotToExist.Any(),"The reference of NUnitTestAdapter - Microsoft.VisualStudio.TestPlatform.ObjectModel must be set Copy Local to false");
Assert.IsTrue(!filesNotToExist.Any(), "The reference of NUnitTestAdapter - Microsoft.VisualStudio.TestPlatform.ObjectModel must be set Copy Local to false");
}

[Test]
public void ThatTheReferenceToMicrosoftTestObjectModelPointsToVS2012Version()
{
var dir = Directory.GetCurrentDirectory();
var assembly = Assembly.LoadFrom(dir + "/NUnit.VisualStudio.TestAdapter.dll");
var refNames = assembly.GetReferencedAssemblies().Where(ass=>ass.Name=="Microsoft.VisualStudio.TestPlatform.ObjectModel").ToList();
var refNames = assembly.GetReferencedAssemblies().Where(ass => ass.Name == "Microsoft.VisualStudio.TestPlatform.ObjectModel").ToList();
Assert.IsTrue(refNames != null && refNames.Count() == 1, "No reference to Microsoft.VisualStudio.TestPlatform.ObjectModel found");
Assert.IsTrue(refNames[0].Version.Major == 11, "Microsoft.VisualStudio.TestPlatform.ObjectModel must point to the 2012 version (11)");

}

[Test]
public void ThatAdapterReferencesThe263VersionOfFramework()
public void ThatAdapterReferencesThe264VersionOfFramework()
{
var dir = Directory.GetCurrentDirectory();
var assembly = Assembly.LoadFrom(dir + "/NUnit.VisualStudio.TestAdapter.dll");
var refNames = assembly.GetReferencedAssemblies().Where(ass => ass.Name == "nunit.core").ToList();
Assert.IsTrue(refNames != null && refNames.Count() == 1, "No reference to Microsoft.VisualStudio.TestPlatform.ObjectModel found");
var nunitVersion = refNames[0].Version;
Assert.IsTrue(nunitVersion.Major==2 && nunitVersion.Minor==6 && nunitVersion.Build==4,"nunit must be of version 2.6.4");
Assert.IsTrue(nunitVersion.Major == 2 && nunitVersion.Minor == 6 && nunitVersion.Build == 4, "nunit must be of version 2.6.4");
}

[Test]
public void ThatAllDllsUsedAreNetFramework35()
{
string config = "release";
var currentdir = Directory.GetCurrentDirectory();
var dir = Path.Combine(currentdir, $"../../../../bin/{config}");
var files = Directory.GetFiles(dir, "*.dll");
foreach (var file in files)
{
var refAssembly = Assembly.ReflectionOnlyLoadFrom(file);
var framework = refAssembly.ImageRuntimeVersion;
Assert.That(framework, Is.EqualTo("v2.0.50727"),
$"The adapter requires framework 2.0 for all dlls, however {refAssembly.FullName} in {config} is using {framework}");
}
}


}
}
2 changes: 1 addition & 1 deletion src/NUnitTestAdapterTests/TestConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class TestConverterTests
private static readonly string ThisAssemblyPath =
Path.GetFullPath("NUnit.VisualStudio.TestAdapter.Tests.dll");
private static readonly string ThisCodeFile =
Path.GetFullPath(@"..\..\src\NUnitTestAdapterTests\TestConverterTests.cs");
Path.GetFullPath(@"..\..\TestConverterTests.cs");

// NOTE: If the location of the FakeTestCase method in the
// file changes, update the value of FAKE_LINE_NUMBER.
Expand Down
4 changes: 2 additions & 2 deletions src/empty-assembly/empty-assembly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\bin\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
Expand All @@ -60,7 +60,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\bin\Release\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
Expand Down
4 changes: 2 additions & 2 deletions src/mock-assembly/mock-assembly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\bin\Debug\</OutputPath>
<OutputPath>bin\Debug\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
Expand All @@ -60,7 +60,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\bin\Release\</OutputPath>
<OutputPath>bin\Release\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
Expand Down

0 comments on commit de8a118

Please sign in to comment.