Skip to content

Commit

Permalink
Adding Microsoft.VisualStudio.ArchitectureTools.PEReader.dll to Exten…
Browse files Browse the repository at this point in the history
…sions (#2041)

* Adding PEReader to extensions
  • Loading branch information
vagisha-nidhi authored Jun 6, 2019
1 parent 824d905 commit 537412c
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 1 deletion.
3 changes: 3 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ function Create-VsixPackage
$legacyDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.Internal.TestPlatform.Extensions\$testPlatformExternalsVersion\contentFiles\any\any"
Copy-Item -Recurse $legacyDir\* $packageDir -Force

# Copy Microsoft.VisualStudio.ArchitectureTools.PEReader to Extensions
Copy-Item $legacyDir\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll $extensionsPackageDir -Force

# Copy QtAgent Related depedencies
$legacyDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.VisualStudio.QualityTools\$testPlatformExternalsVersion\contentFiles\any\any"
Copy-Item -Recurse $legacyDir\* $packageDir -Force
Expand Down
2 changes: 1 addition & 1 deletion src/package/nuspec/Microsoft.TestPlatform.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<file src="net451\$Runtime$\Microsoft.TestPlatform.Utilities.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.Utilities.dll" />
<file src="net451\$Runtime$\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.dll" />
<file src="net451\$Runtime$\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.xml" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.xml" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Extensions\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Coverage.Analysis.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Coverage.Analysis.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Coverage.Interop.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Coverage.Interop.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Diagnostics.Utilities.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Diagnostics.Utilities.dll" />
Expand Down
24 changes: 24 additions & 0 deletions test/Microsoft.TestPlatform.AcceptanceTests/DataCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,30 @@ public void ExecuteTestsWithDataCollectionUsingCollectArgument(RunnerInfo runner
this.VaildateDataCollectorOutput();
}

[TestMethod]
[NetCoreTargetFrameworkDataSource]
public void DataCollectorAssemblyLoadingShouldNotThrowErrorForNetCore(RunnerInfo runnerInfo)
{
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);

var arguments = PrepareArguments(GetAssetFullPath("AppDomainGetAssembliesTestProject.dll", "netcoreapp2.0"), string.Empty, string.Empty, this.FrameworkArgValue);

this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 0, 0);
}

[TestMethod]
[NetFullTargetFrameworkDataSource]
public void DataCollectorAssemblyLoadingShouldNotThrowErrorForFullFramework(RunnerInfo runnerInfo)
{
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);

var arguments = PrepareArguments(GetAssetFullPath("AppDomainGetAssembliesTestProject.dll"), string.Empty, string.Empty, this.FrameworkArgValue);

this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 0, 0);
}

private static void CreateDataCollectionRunSettingsFile(string destinationRunsettingsPath, Dictionary<string, string> dataCollectionAttributes)
{
var doc = new XmlDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ protected string GetAssetFullPath(string assetName)
return this.testEnvironment.GetTestAsset(assetName);
}

protected string GetAssetFullPath(string assetName, string targetFramework)
{
return this.testEnvironment.GetTestAsset(assetName, targetFramework);
}

protected string GetTestAdapterPath(UnitTestFramework testFramework = UnitTestFramework.MSTest)
{
string adapterRelativePath = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.1" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions test/TestAssets/AppDomainGetAssembliesTestProject/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;

namespace AppDomainGetAssembliesTestProject
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
// https://github.com/microsoft/vstest/issues/2008
// GetAssemblies adds datacollectors to test host appdomain which was failing in the above issue

var allAssemblies = AppDomain.CurrentDomain.GetAssemblies();

foreach(var assembly in allAssemblies)
{
var typeInfo = assembly.GetTypes();
}
}
}
}
6 changes: 6 additions & 0 deletions test/TestAssets/TestAssets.sln/TestAssets.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LegacySettingsUnitTestProje
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewtonSoftDependency", "..\NewtonSoftDependency\NewtonSoftDependency.csproj", "{79EDA259-5EA0-45F0-990A-F078427E198A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppDomainGetAssembliesTestProject", "..\AppDomainGetAssembliesTestProject\AppDomainGetAssembliesTestProject.csproj", "{BF090BCE-CC7D-4359-93E2-30F2B454F751}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -135,6 +137,10 @@ Global
{79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.Build.0 = Release|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 537412c

Please sign in to comment.