Update the new version of Microsoft.TestPlatform.cli which has fix related to testAdapterPath.
Updated the test project to reflect the same.
This commit is contained in:
parent
a3a58423d1
commit
b240b855c1
6 changed files with 60 additions and 53 deletions
|
@ -906,20 +906,20 @@ Global
|
|||
{0E083818-2320-4388-8007-4F720FD5C634}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.Build.0 = Debug|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.ActiveCfg = MinSizeRel|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.Build.0 = MinSizeRel|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.ActiveCfg = MinSizeRel|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.Build.0 = MinSizeRel|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|Any CPU.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.MinSizeRel|x64.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.ActiveCfg = Release|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.Build.0 = Release|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.Build.0 = RelWithDebInfo|x64
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.Release|x64.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU
|
||||
{1F2EF070-AC5F-4078-AFB0-65745AC691B9}.RelWithDebInfo|x64.Build.0 = Release|Any CPU
|
||||
{A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A62EDFBD-9E6D-458F-983E-1A86DA52AE1E}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
|
||||
namespace TestNamespace
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[TestClass]
|
||||
public class VSTestTests
|
||||
{
|
||||
|
@ -10,10 +18,10 @@ namespace TestNamespace
|
|||
{
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestMethod]
|
||||
public void VSTestFailTest()
|
||||
{
|
||||
Assert.Fail();
|
||||
Assert.Fail();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,23 +3,35 @@
|
|||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
<OutputPath>bin\$(Configuration)\netcoreapp1.0</OutputPath>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>netcoreapp1.0</TargetFrameworks>
|
||||
<OutputPath>bin\$(Configuration)</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<None Include="project.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NETCore.Sdk">
|
||||
<Version>1.0.0-alpha-20160930-1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestFramework">
|
||||
<Version>1.0.4-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="MSTest.TestAdapter">
|
||||
<Version>1.1.3-preview</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.TestHost">
|
||||
<Version>15.0.0-preview-20160928-07</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TestPlatform.ObjectModel">
|
||||
<Version>15.0.0-preview-20160928-07</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="AfterBuild">
|
||||
<Copy SourceFiles="$(NuGetPackageRoot)\mstest.testadapter\1.0.3-preview\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
|
||||
<Copy SourceFiles="$(NuGetPackageRoot)\mstest.testadapter\1.0.3-preview\build\dotnet\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
|
||||
<Copy SourceFiles="$(NuGetPackageRoot)\mstest.testadapter\1.0.3-preview\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
|
||||
<Copy SourceFiles="$(NuGetPackageRoot)\mstest.testframework\1.0.1-preview\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
|
||||
<Copy SourceFiles="$(NuGetPackageRoot)\mstest.testframework\1.0.1-preview\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true"/>
|
||||
</Target>
|
||||
</Project>
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"MSTest.TestAdapter": "1.0.3-preview",
|
||||
"MSTest.TestFramework": "1.0.1-preview"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Sdk": "1.0.0-alpha-20160914-1",
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.0.1",
|
||||
"type": "platform"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"dnxcore50",
|
||||
"portable-net45+win8"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,7 +28,8 @@
|
|||
"Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60922-08",
|
||||
"System.Runtime.Serialization.Xml": "4.1.1",
|
||||
"NuGet.Build.Tasks": "3.6.0-beta.1.msbuild.17",
|
||||
"Microsoft.TestPlatform.CLI": "15.0.0-preview-20160915-01"
|
||||
"Microsoft.TestPlatform.CLI": "15.0.0-preview-20161003-01",
|
||||
"Microsoft.TestPlatform.Build": "15.0.0-preview-20160928-07"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
|
|
|
@ -11,18 +11,25 @@ using Microsoft.DotNet.Cli.Utils;
|
|||
|
||||
namespace Microsoft.DotNet.Cli.VSTest.Tests
|
||||
{
|
||||
public class VSTestTests: TestBase
|
||||
public class VSTestTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void TestsFromAGivenContainerShouldRunWithExpectedOutput()
|
||||
{
|
||||
// Copy DotNetCoreTestProject project in output directory of project dotnet-vstest.Tests
|
||||
string testAppName = "VSTestDotNetCoreProject";
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName).WithLockFiles();
|
||||
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);
|
||||
|
||||
string testProjectDirectory = testInstance.TestRoot;
|
||||
|
||||
// Build project DotNetCoreTestProject
|
||||
// Restore project VSTestDotNetCoreProject
|
||||
new Restore3Command()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
.Should()
|
||||
.Pass();
|
||||
|
||||
// Build project VSTestDotNetCoreProject
|
||||
new Build3Command()
|
||||
.WithWorkingDirectory(testProjectDirectory)
|
||||
.Execute()
|
||||
|
@ -33,7 +40,7 @@ namespace Microsoft.DotNet.Cli.VSTest.Tests
|
|||
string configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
||||
string testAdapterPath = Path.Combine(testProjectDirectory, "bin", configuration, "netcoreapp1.0");
|
||||
string outputDll = Path.Combine(testAdapterPath, $"{testAppName}.dll");
|
||||
string argsForVstest = string.Concat("\"", outputDll, "\"", " --TestAdapterPath:", "\"", testAdapterPath, "\"");
|
||||
string argsForVstest = string.Concat("\"", outputDll, "\"");
|
||||
|
||||
// Call vstest
|
||||
CommandResult result = new VSTestCommand().ExecuteWithCapturedOutput(argsForVstest);
|
||||
|
|
Loading…
Reference in a new issue