Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Bug fixes #4810

Merged
merged 6 commits into from
Nov 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.0.5-preview</Version>
<Version>1.0.6-preview</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.1.4-preview</Version>
<Version>1.1.5-preview</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.0.5-preview</Version>
<Version>1.0.6-preview</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.1.4-preview</Version>
<Version>1.1.5-preview</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft.CSharp.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
<PackageReference Include="xunit">
<Version>2.2.0-beta4-build3444</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
<PackageReference Include="xunit">
<Version>2.2.0-beta4-build3444</Version>
Expand Down
2 changes: 1 addition & 1 deletion build/Microsoft.DotNet.Cli.Compile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

<!-- Workaround for https://github.com/dotnet/sdk/issues/115 -->
<ItemGroup>
<HackFilesToCopy Include="$(NuGetPackagesDir)\microsoft.build.runtime\15.1.0-preview-000370-00\contentFiles\any\netcoreapp1.0\**;$(NuGetPackagesDir)\microsoft.codeanalysis.build.tasks\2.0.0-beta6-60922-08\contentFiles\any\any\**;$(NuGetPackagesDir)\microsoft.testplatform.cli\15.0.0-preview-20161102-02\contentFiles\any\any\**" />
<HackFilesToCopy Include="$(NuGetPackagesDir)\microsoft.build.runtime\15.1.0-preview-000370-00\contentFiles\any\netcoreapp1.0\**;$(NuGetPackagesDir)\microsoft.codeanalysis.build.tasks\2.0.0-beta6-60922-08\contentFiles\any\any\**;$(NuGetPackagesDir)\microsoft.testplatform.cli\15.0.0-preview-20161123-03\contentFiles\any\any\**" />
</ItemGroup>
<Copy SourceFiles="@(HackFilesToCopy)"
DestinationFiles="@(HackFilesToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ Copyright (c) .NET Foundation. All rights reserved.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VSTestTaskAssemblyFile Condition="$(VSTestTaskAssemblyFile) == ''">$(MSBuildExtensionsPath)\Microsoft.TestPlatform.Build.dll</VSTestTaskAssemblyFile>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<UsingTask TaskName="Microsoft.TestPlatform.Build.Tasks.BuildLogTask" AssemblyFile="$(VSTestTaskAssemblyFile)" />
<!--
===================================================================================
DispatchToInnerBuildsWithVSTestTarget
Expand All @@ -38,7 +40,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<MSBuild Projects="$(MSBuildProjectFile)"
Condition="'$(TargetFrameworks)' != '' "
Targets="$(InnerVSTestTargets)"
Properties="TargetFramework=%(_TargetFramework.Identity);VSTestNoBuild=true">
Properties="TargetFramework=%(_TargetFramework.Identity);VSTestNoBuild=true"
ContinueOnError="true">
<Output ItemName="InnerOutput" TaskParameter="TargetOutputs" />
</MSBuild>
</Target>
Expand All @@ -62,11 +65,17 @@ Copyright (c) .NET Foundation. All rights reserved.
=================================================================================
-->
<Target Name="VSTest" >
<CallTarget Condition="'$(VSTestNoBuild)' != 'true'" Targets="Build" />
<CallTarget Condition="'$(VSTestNoBuild)' != 'true'" Targets="BuildProject" />
<CallTarget Targets="SetVSTestInnerTarget" />
<CallTarget Targets="DispatchToInnerBuildsWithVSTestTarget" />
</Target>

<Target Name="BuildProject">
<Microsoft.TestPlatform.Build.Tasks.BuildLogTask BuildStarted="True" />
<CallTarget Targets="Build" />
<Microsoft.TestPlatform.Build.Tasks.BuildLogTask />
</Target>

<Target Name="SetVSTestInnerTarget" Returns="@(InnerOutput)">
<PropertyGroup Condition="'$(InnerVSTestTargets)' == ''">
<InnerVSTestTargets>VSTest</InnerVSTestTargets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.1.3-preview</Version>
<Version>1.1.5-preview</Version>
</PackageReference>
<PackageReference Include="MSTest.TestFramework">
<Version>1.0.4-preview</Version>
<Version>1.0.6-preview</Version>
</PackageReference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk">
<Version>15.0.0-preview-20161024-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
<PackageReference Include="xunit">
<Version>2.2.0-beta4-build3444</Version>
Expand Down
2 changes: 2 additions & 0 deletions src/dotnet/commands/dotnet-test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static int Run(string[] args)
Description = "Test Driver for the .NET Platform"
};

cmd.AllowArgumentSeparator = true;
cmd.ArgumentSeparatorHelpText = HelpMessageStrings.MSBuildAdditionalArgsHelpText;
cmd.HelpOption("-h|--help");

var argRoot = cmd.Argument(
Expand Down
4 changes: 2 additions & 2 deletions src/redist/redist.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
<Version>4.0.0-rc2</Version>
</PackageReference>
<PackageReference Include="Microsoft.TestPlatform.CLI">
<Version>15.0.0-preview-20161102-02</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
<PackageReference Include="Microsoft.TestPlatform.Build">
<Version>15.0.0-preview-20161107-06</Version>
<Version>15.0.0-preview-20161123-03</Version>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Microsoft.DotNet.Cli.Test.Tests
{
public class GivenDotnetTest3BuildsAndRunsTestFromCsprojForMultipleTFM : TestBase
public class GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM : TestBase
{
[WindowsOnlyFact(Skip="https://github.com/dotnet/cli/issues/4616")]
public void MStestMultiTFM()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,40 @@ public void TestWillNotBuildTheProjectIfNoBuildArgsIsGiven()
// Verify
result.StdOut.Should().Contain(expectedError);
}

[Fact]
public void TestWillCreateTrxLogger()
{
// Copy VSTestDotNetCore project in output directory of project dotnet-vstest.Tests
string testAppName = "VSTestDotNetCore";
TestInstance testInstance = TestAssetsManager.CreateTestInstance(testAppName);

string testProjectDirectory = testInstance.TestRoot;

// Restore project VSTestDotNetCore
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
.Execute()
.Should()
.Pass();

string trxLoggerDirectory = Path.Combine(testProjectDirectory, "TestResults");

// Delete trxLoggerDirectory if it exist
if(Directory.Exists(trxLoggerDirectory))
{
Directory.Delete(trxLoggerDirectory, true);
}

// Call test with logger enable
CommandResult result = new DotnetTestCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("--logger:trx");

// Verify
String[] trxFiles = Directory.GetFiles(trxLoggerDirectory, "*.trx");
Assert.Equal(1, trxFiles.Length);
result.StdOut.Should().Contain(trxFiles[0]);
}
}
}