diff --git a/scripts/test.ps1 b/scripts/test.ps1 index 5892c3031c..ab92c794d5 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -185,10 +185,13 @@ function Run-Test([string[]] $testContainers, [string[]] $netCoreTestContainers) function Get-VSTestPath { - $vsInstallPath = Locate-VsInstallPath - $vstestPath = Join-Path -path $vsInstallPath "Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" + $versionsFile = "$PSScriptRoot\build\TestFx.Versions.targets" + $TestPlatformVersion = (([XML](Get-Content $versionsFile)).Project.PropertyGroup.TestPlatformVersion).InnerText + + $vsInstallPath = "$PSScriptRoot\..\packages\Microsoft.TestPlatform.$TestPlatformVersion\" + $vstestPath = Join-Path -path $vsInstallPath "tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe" return Resolve-Path -path $vstestPath } - + Print-Help Invoke-Test diff --git a/src/Adapter/MSTest.CoreAdapter/Properties/AssemblyInfo.cs b/src/Adapter/MSTest.CoreAdapter/Properties/AssemblyInfo.cs index 0fb6360653..ef1590b4a6 100644 --- a/src/Adapter/MSTest.CoreAdapter/Properties/AssemblyInfo.cs +++ b/src/Adapter/MSTest.CoreAdapter/Properties/AssemblyInfo.cs @@ -3,6 +3,8 @@ using System.Reflection; using System.Resources; +using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -16,6 +18,7 @@ [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] +[assembly: TypesToLoad(typeof(MSTestDiscoverer), typeof(MSTestExecutor))] // Version information for an assembly consists of the following four values: // diff --git a/test/UnitTests/PlatformServices.Desktop.Unit.Tests/Services/DesktopTestSourceHostTests.cs b/test/UnitTests/PlatformServices.Desktop.Unit.Tests/Services/DesktopTestSourceHostTests.cs index 6a29a01bd1..abc36caf71 100644 --- a/test/UnitTests/PlatformServices.Desktop.Unit.Tests/Services/DesktopTestSourceHostTests.cs +++ b/test/UnitTests/PlatformServices.Desktop.Unit.Tests/Services/DesktopTestSourceHostTests.cs @@ -37,8 +37,15 @@ public void GetResolutionPathsShouldAddPublicAndPrivateAssemblyPath() List result = sut.GetResolutionPaths("DummyAssembly.dll", isPortableMode: false); // Assert - Assert.IsTrue(result.Contains(VSInstallationUtilities.PathToPublicAssemblies)); - Assert.IsTrue(result.Contains(VSInstallationUtilities.PathToPrivateAssemblies)); + if (!string.IsNullOrWhiteSpace(VSInstallationUtilities.PathToPublicAssemblies)) + { + Assert.IsTrue(result.Contains(VSInstallationUtilities.PathToPublicAssemblies)); + } + + if (!string.IsNullOrWhiteSpace(VSInstallationUtilities.PathToPrivateAssemblies)) + { + Assert.IsTrue(result.Contains(VSInstallationUtilities.PathToPrivateAssemblies)); + } } [TestMethod]