Skip to content

Commit da7d325

Browse files
JonathanWilkinsJonathanWilkins
authored andcommitted
Merge remote-tracking branch 'origin/dev'
Conflicts: Source/Machine.VSTestAdapter.VSIX/Machine.VSTestAdapter.VSIX.csproj machine.vstestadapter.sln
2 parents ebadd88 + 2c4d964 commit da7d325

35 files changed

+250
-111
lines changed

Source/Machine.VSTestAdapter.Specs/Discoverer/When_discovering_the_customdelegateproject.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class When_discovering_the_customdelegateproject : WithFakes
1616
private static ISpecificationDiscoverer discoverer;
1717
private static IEnumerable<MSpecTestCase> results;
1818

19-
private static string CustomDelegateTypeSpec_Type = "When_getting_the_hash_code_of_equal_strings";
19+
private static string CustomDelegateTypeSpec_Type = "When_getting_the_hash_code_of_equal_strings_with_custom_assert_delegate";
2020

2121
private Establish context = () =>
2222
{
@@ -32,10 +32,19 @@ public class When_discovering_the_customdelegateproject : WithFakes
3232
results = discoverer.EnumerateSpecs(path);
3333
};
3434

35-
private It should_discover_the_customdelegate_type_spec = () =>
35+
private It should_discover_the_customdelegate_type_spec_they = () =>
3636
{
37-
MSpecTestCase discoveredSpec = results.Where(x => x.ContextType == CustomDelegateTypeSpec_Type).SingleOrDefault();
37+
MSpecTestCase discoveredSpec = results.Where(x => x.ContextType == CustomDelegateTypeSpec_Type
38+
&& x.SpecificationName == "should_have_the_same_hash_code" ).SingleOrDefault();
3839
discoveredSpec.ShouldNotBeNull();
3940
};
41+
42+
It should_not_have_duplicates = () => {
43+
var typeCount = results.Where(x => x.ContextFullType.Contains(CustomDelegateTypeSpec_Type)).Count();
44+
45+
typeCount.ShouldEqual(2);
46+
};
47+
48+
4049
}
4150
}

Source/Machine.VSTestAdapter.Specs/Machine.VSTestAdapter.Specs.csproj

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,23 @@
4848
<HintPath>..\..\packages\Machine.Specifications.Should.0.7.1\lib\net45\Machine.Specifications.Should.dll</HintPath>
4949
</Reference>
5050
<Reference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel">
51-
<HintPath>..\Microsoft.VisualStudio.TestPlatform.ObjectModel Binaries\VS11\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
51+
<HintPath>..\Microsoft.VisualStudio.TestPlatform.ObjectModel Binaries\VS14\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll</HintPath>
5252
</Reference>
53-
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
54-
<SpecificVersion>False</SpecificVersion>
55-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.dll</HintPath>
53+
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
54+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
55+
<Private>True</Private>
5656
</Reference>
57-
<Reference Include="Mono.Cecil.Mdb">
58-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
57+
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
58+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
59+
<Private>True</Private>
5960
</Reference>
60-
<Reference Include="Mono.Cecil.Pdb">
61-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
61+
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
62+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
63+
<Private>True</Private>
6264
</Reference>
63-
<Reference Include="Mono.Cecil.Rocks">
64-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
65+
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
66+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
67+
<Private>True</Private>
6568
</Reference>
6669
<Reference Include="NSubstitute">
6770
<HintPath>..\..\packages\NSubstitute.1.7.2.0\lib\NET45\NSubstitute.dll</HintPath>
@@ -88,13 +91,51 @@
8891
<ItemGroup>
8992
<None Include="packages.config" />
9093
</ItemGroup>
91-
<ItemGroup />
9294
<ItemGroup>
9395
<ProjectReference Include="..\Machine.VSTestAdapter\Machine.VSTestAdapter.csproj">
9496
<Project>{53236a16-453d-49c2-880d-87523ece381f}</Project>
9597
<Name>Machine.VSTestAdapter</Name>
9698
</ProjectReference>
9799
</ItemGroup>
100+
<ItemGroup />
101+
<ItemGroup>
102+
<Content Include="..\TestData\bin\CustomDelegateSpec.dll">
103+
<Link>TestData\CustomDelegateSpec.dll</Link>
104+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
105+
</Content>
106+
<Content Include="..\TestData\bin\CustomDelegateSpec.pdb">
107+
<Link>TestData\CustomDelegateSpec.pdb</Link>
108+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
109+
</Content>
110+
<Content Include="..\TestData\bin\Machine.Specifications.Clr4.dll">
111+
<Link>TestData\Machine.Specifications.Clr4.dll</Link>
112+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
113+
</Content>
114+
<Content Include="..\TestData\bin\Machine.Specifications.dll">
115+
<Link>TestData\Machine.Specifications.dll</Link>
116+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
117+
</Content>
118+
<Content Include="..\TestData\bin\Machine.Specifications.Should.dll">
119+
<Link>TestData\Machine.Specifications.Should.dll</Link>
120+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
121+
</Content>
122+
<Content Include="..\TestData\bin\OneNestedTypeSpec.dll">
123+
<Link>TestData\OneNestedTypeSpec.dll</Link>
124+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
125+
</Content>
126+
<Content Include="..\TestData\bin\OneNestedTypeSpec.pdb">
127+
<Link>TestData\OneNestedTypeSpec.pdb</Link>
128+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
129+
</Content>
130+
<Content Include="..\TestData\bin\OnePassingOneFailingOneThrowingSpec.dll">
131+
<Link>TestData\OnePassingOneFailingOneThrowingSpec.dll</Link>
132+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
133+
</Content>
134+
<Content Include="..\TestData\bin\OnePassingOneFailingOneThrowingSpec.pdb">
135+
<Link>TestData\OnePassingOneFailingOneThrowingSpec.pdb</Link>
136+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
137+
</Content>
138+
</ItemGroup>
98139
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
99140
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
100141
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Machine.Fakes" version="2.1.0" targetFramework="net45" />
4-
<package id="Machine.Fakes.NSubstitute" version="2.1.0" targetFramework="net45" />
5-
<package id="Machine.Specifications" version="0.7.0" targetFramework="net45" />
6-
<package id="Machine.Specifications.Should" version="0.7.1" targetFramework="net45" />
7-
<package id="Mono.Cecil" version="0.9.5.4" targetFramework="net45" />
8-
<package id="NSubstitute" version="1.7.2.0" targetFramework="net45" />
3+
<package id="Machine.Fakes" version="2.1.0" targetFramework="net45" userInstalled="true" />
4+
<package id="Machine.Fakes.NSubstitute" version="2.1.0" targetFramework="net45" userInstalled="true" />
5+
<package id="Machine.Specifications" version="0.7.0" targetFramework="net45" userInstalled="true" />
6+
<package id="Machine.Specifications.Should" version="0.7.1" targetFramework="net45" userInstalled="true" />
7+
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" userInstalled="true" />
8+
<package id="NSubstitute" version="1.7.2.0" targetFramework="net45" userInstalled="true" />
99
</packages>

Source/Machine.VSTestAdapter.VSIX/License.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012, 2013, 2014 Eugene Duvenage
1+
Copyright (c) 2012, 2013, 2014, 2015 Jonathan Wilkins
22

33
This license governs use of the accompanying software. If you use the software, you
44
accept this license. If you do not accept the license, do not use the software.

Source/Machine.VSTestAdapter.VSIX/Machine.VSTestAdapter.VSIX.csproj

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
<UpgradeBackupLocation>
1212
</UpgradeBackupLocation>
1313
<OldToolsVersion>4.0</OldToolsVersion>
14+
<PublishUrl>publish\</PublishUrl>
15+
<Install>true</Install>
16+
<InstallFrom>Disk</InstallFrom>
17+
<UpdateEnabled>false</UpdateEnabled>
18+
<UpdateMode>Foreground</UpdateMode>
19+
<UpdateInterval>7</UpdateInterval>
20+
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
21+
<UpdatePeriodically>false</UpdatePeriodically>
22+
<UpdateRequired>false</UpdateRequired>
23+
<MapFileExtensions>true</MapFileExtensions>
24+
<ApplicationRevision>0</ApplicationRevision>
25+
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26+
<IsWebBootstrapper>false</IsWebBootstrapper>
27+
<UseApplicationTrust>false</UseApplicationTrust>
28+
<BootstrapperEnabled>true</BootstrapperEnabled>
1429
</PropertyGroup>
1530
<PropertyGroup>
1631
<ApplicationIcon>Machine.VSTestAdapter-32x32.ico</ApplicationIcon>
@@ -57,35 +72,18 @@
5772
</ItemGroup>
5873
<ItemGroup>
5974
<None Include="packages.config" />
60-
<None Include="source.extension.vsixmanifest">
61-
<SubType>Designer</SubType>
62-
</None>
75+
<None Include="source.extension.vsixmanifest" />
6376
</ItemGroup>
6477
<ItemGroup>
78+
<ProjectReference Include="..\Machine.Specifications.VSRunner\Machine.Specifications.VSRunner.csproj">
79+
<Project>{f88cbebd-9d83-4899-bf61-04c35eca1663}</Project>
80+
<Name>Machine.Specifications.VSRunner</Name>
81+
</ProjectReference>
6582
<ProjectReference Include="..\Machine.VSTestAdapter\Machine.VSTestAdapter.csproj">
6683
<Project>{53236a16-453d-49c2-880d-87523ece381f}</Project>
6784
<Name>Machine.VSTestAdapter</Name>
6885
</ProjectReference>
6986
</ItemGroup>
70-
<ItemGroup>
71-
<Reference Include="Machine.Specifications.VSRunner, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
72-
<SpecificVersion>False</SpecificVersion>
73-
<HintPath>..\Machine.Specifications.VSRunner\bin\$(Configuration)\Machine.Specifications.VSRunner.dll</HintPath>
74-
</Reference>
75-
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
76-
<SpecificVersion>False</SpecificVersion>
77-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.dll</HintPath>
78-
</Reference>
79-
<Reference Include="Mono.Cecil.Mdb">
80-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Mdb.dll</HintPath>
81-
</Reference>
82-
<Reference Include="Mono.Cecil.Pdb">
83-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Pdb.dll</HintPath>
84-
</Reference>
85-
<Reference Include="Mono.Cecil.Rocks">
86-
<HintPath>..\..\packages\Mono.Cecil.0.9.5.4\lib\net40\Mono.Cecil.Rocks.dll</HintPath>
87-
</Reference>
88-
</ItemGroup>
8987
<ItemGroup>
9088
<Content Include="License.txt">
9189
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -108,6 +106,36 @@
108106
<IncludeInVSIX>true</IncludeInVSIX>
109107
</Content>
110108
</ItemGroup>
109+
<ItemGroup>
110+
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
111+
<Visible>False</Visible>
112+
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
113+
<Install>true</Install>
114+
</BootstrapperPackage>
115+
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
116+
<Visible>False</Visible>
117+
<ProductName>.NET Framework 3.5 SP1</ProductName>
118+
<Install>false</Install>
119+
</BootstrapperPackage>
120+
</ItemGroup>
121+
<ItemGroup>
122+
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
123+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
124+
<Private>True</Private>
125+
</Reference>
126+
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
127+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
128+
<Private>True</Private>
129+
</Reference>
130+
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
131+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
132+
<Private>True</Private>
133+
</Reference>
134+
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
135+
<HintPath>..\..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
136+
<Private>True</Private>
137+
</Reference>
138+
</ItemGroup>
111139
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
112140
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
113141
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Mono.Cecil" version="0.9.5.4" targetFramework="net45" />
3+
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net45" userInstalled="true" />
44
</packages>

Source/Machine.VSTestAdapter.VSIX/source.extension.vsixmanifest

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
xmlns="http://schemas.microsoft.com/developer/vsx-schema/2010">
44
<Identifier Id="Machine.VSTestAdapter.Eugene Duvenage.889BA1F5-0E35-48BC-8D0F-F06489464E05">
55
<Name xml:space="preserve">MSpec Test Adapter</Name>
6-
<Author>Eugene Duvenage</Author>
7-
<Version>0.1.5.0</Version>
6+
<Author>Jonathan Wilkinse</Author>
7+
<Version>0.1.6.0</Version>
88
<Description xml:space="preserve">Machine Specifications Visual Studio 2012, 2013 Test Adapter</Description>
99
<Locale>1033</Locale>
10-
<MoreInfoUrl>https://github.com/eugeneduvenage/machine.vstestadapter</MoreInfoUrl>
10+
<MoreInfoUrl>https://github.com/jonathanwilkins/machine.vstestadapter</MoreInfoUrl>
1111
<License>License.txt</License>
1212
<Icon>Machine.VSTestAdapter-64x64.png</Icon>
1313
<PreviewImage>Machine.VSTestAdapter-256x256.png</PreviewImage>

Source/Machine.VSTestAdapter/MSpecTestAdapter.cs

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Machine.VSTestAdapter
1313
[FileExtension(".dll")]
1414
[ExtensionUri("executor://machine.vstestadapter")]
1515
[DefaultExecutorUri("executor://machine.vstestadapter")]
16-
public class MSpecTestAdapter : ITestDiscoverer, ITestExecutor
16+
public partial class MSpecTestAdapter : ITestDiscoverer
1717
{
1818
public const string ExecutorUri = "executor://machine.vstestadapter";
1919
public const string VSObjectModelAssemblyName = "Microsoft.VisualStudio.TestPlatform.ObjectModel";
@@ -91,50 +91,6 @@ public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discove
9191
logger.SendMessage(TestMessageLevel.Informational, string.Format(Strings.DISCOVERER_COMPLETE, discoveredSpecCount, sources.Count(), sourcesWithSpecs));
9292
}
9393

94-
public void Cancel()
95-
{
96-
}
97-
98-
public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
99-
{
100-
// this a temporary hack until I can figure out why running the specs per assembly directly using mspec does not work with a large number of specifications
101-
// when they are run diectly the first 100 or so specs run fine and then an error occurs saying it has taken more than 10 seconds and is being stopped
102-
// for now we just rediscover and run them like that, makes no sense
103-
TestCaseCollector collector = new TestCaseCollector();
104-
this.DiscoverTests(sources, runContext, frameworkHandle, collector);
105-
this.RunTests(collector.TestCases, runContext, frameworkHandle);
106-
}
107-
108-
public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
109-
{
110-
111-
112-
frameworkHandle.SendMessage(TestMessageLevel.Informational, Strings.EXECUTOR_STARTING);
113-
int executedSpecCount = 0;
114-
string currentAsssembly = string.Empty;
115-
try
116-
{
117-
ISpecificationExecutor specificationExecutor = this.adapterFactory.CreateExecutor();
118-
IEnumerable<IGrouping<string, TestCase>> groupBySource = tests.GroupBy(x => x.Source);
119-
foreach (IGrouping<string, TestCase> grouping in groupBySource)
120-
{
121-
currentAsssembly = grouping.Key;
122-
frameworkHandle.SendMessage(TestMessageLevel.Informational, string.Format(Strings.EXECUTOR_EXECUTINGIN, currentAsssembly));
123-
specificationExecutor.RunAssemblySpecifications(currentAsssembly, MSpecTestAdapter.uri, runContext, frameworkHandle, grouping);
124-
executedSpecCount += grouping.Count();
125-
}
126-
127-
frameworkHandle.SendMessage(TestMessageLevel.Informational, String.Format(Strings.EXECUTOR_COMPLETE, executedSpecCount, groupBySource.Count()));
128-
}
129-
catch (Exception ex)
130-
{
131-
frameworkHandle.SendMessage(TestMessageLevel.Error, string.Format(Strings.EXECUTOR_ERROR, currentAsssembly, ex.Message));
132-
}
133-
finally
134-
{
135-
}
136-
}
137-
13894
public IEnumerable<TestCase> GetTestCases(ISpecificationDiscoverer discoverer, string sourcePath)
13995
{
14096
if (discoverer != null)
@@ -152,4 +108,5 @@ private dynamic CreateTrait(string traitName, string traitValue)
152108
return vsObjectModel.CreateInstance("Microsoft.VisualStudio.TestPlatform.ObjectModel.Trait", false, BindingFlags.CreateInstance, null, new object[] { traitName, traitValue }, null, null);
153109
}
154110
}
111+
155112
}

0 commit comments

Comments
 (0)