3a9525b5ac
* rel/1.0.1: (66 commits) Update LZMA license with correct text Bump to 2.0.0-rc5-61427-04 Remove duplicate installer suffix Add license text to LZMA SDK license notice Updating the SDK to 1.0.0-alpha-20170224-6 Updating both platform abstractions and dependency model to 1.0.3. Bump Roslyn to 2.0.0-rc5-61424-02 Update Stage0 to use the latest build. Update README with new distros. Back porting #5597 into rel/1.0.0 Fixing the exclude pattern used by the Migration to exclude WEB SDK globs. Remove RID from test package creation Disable migrate and publish web app with content because CI does not have NPM Adding an E2E test for pack with content during migration. Fixing a failing test and adding a few more E2E tests around binplace content for migrated projects. Fix debian_config.json on ubuntu16.10 Updating publish, pack and build of content to use None with Never/false/Never in their metadata for excluded items. Intermediate commit to get a WIP PR out. This adds the None Update with CopyToOutputDirectory set to Never. Switching the CopyToOutput for build and publish and the file for pack to use None Update instead of include. Also, fixed the exclude patterns for web apps. Do not migrate Content that is already included in the Web SDK for web apps. ...
79 lines
3.5 KiB
C#
79 lines
3.5 KiB
C#
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
using FluentAssertions;
|
|
using Microsoft.DotNet.TestFramework;
|
|
using Microsoft.DotNet.Cli.Utils;
|
|
using System.IO;
|
|
using System;
|
|
|
|
namespace Microsoft.DotNet.Cli.Test.Tests
|
|
{
|
|
public class GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM : TestBase
|
|
{
|
|
[WindowsOnlyFact(Skip="https://github.com/dotnet/cli/issues/4616")]
|
|
public void MStestMultiTFM()
|
|
{
|
|
var testProjectDirectory = TestAssets.Get("VSTestDesktopAndNetCore")
|
|
.CreateInstance()
|
|
.WithSourceFiles()
|
|
.WithNuGetConfig(new RepoDirectoriesProvider().TestPackages)
|
|
.Root;
|
|
|
|
var runtime = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
|
|
|
new RestoreCommand()
|
|
.WithWorkingDirectory(testProjectDirectory)
|
|
.WithRuntime(runtime)
|
|
.Execute()
|
|
.Should().Pass();
|
|
|
|
var result = new DotnetTestCommand()
|
|
.WithWorkingDirectory(testProjectDirectory)
|
|
.WithRuntime(runtime)
|
|
.ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal);
|
|
|
|
result.StdOut
|
|
.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.", "because .NET 4.6 tests will pass")
|
|
.And.Contain("Passed TestNamespace.VSTestTests.VSTestPassTestDesktop", "because .NET 4.6 tests will pass")
|
|
.And.Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.", "because netcoreapp1.0 tests will fail")
|
|
.And.Contain("Failed TestNamespace.VSTestTests.VSTestFailTestNetCoreApp", "because netcoreapp1.0 tests will fail");
|
|
result.ExitCode.Should().Be(1);
|
|
}
|
|
|
|
[WindowsOnlyFact]
|
|
public void XunitMultiTFM()
|
|
{
|
|
// Copy VSTestXunitDesktopAndNetCore project in output directory of project dotnet-test.Tests
|
|
string testAppName = "VSTestXunitDesktopAndNetCore";
|
|
var testInstance = TestAssets.Get(testAppName)
|
|
.CreateInstance()
|
|
.WithSourceFiles();
|
|
|
|
var testProjectDirectory = testInstance.Root.FullName;
|
|
|
|
// Restore project VSTestXunitDesktopAndNetCore
|
|
new RestoreCommand()
|
|
.WithWorkingDirectory(testProjectDirectory)
|
|
.Execute()
|
|
.Should()
|
|
.Pass();
|
|
|
|
// Call test
|
|
CommandResult result = new DotnetTestCommand()
|
|
.WithWorkingDirectory(testProjectDirectory)
|
|
.ExecuteWithCapturedOutput(TestBase.ConsoleLoggerOutputNormal);
|
|
|
|
// Verify
|
|
// for target framework net46
|
|
result.StdOut.Should().Contain("Total tests: 3. Passed: 2. Failed: 1. Skipped: 0.");
|
|
result.StdOut.Should().Contain("Passed TestNamespace.VSTestXunitTests.VSTestXunitPassTestDesktop");
|
|
|
|
// for target framework netcoreapp1.0
|
|
result.StdOut.Should().Contain("Total tests: 3. Passed: 1. Failed: 2. Skipped: 0.");
|
|
result.StdOut.Should().Contain("Failed TestNamespace.VSTestXunitTests.VSTestXunitFailTestNetCoreApp");
|
|
result.ExitCode.Should().Be(1);
|
|
}
|
|
}
|
|
}
|