Project.json schema warnings don't get displayed

When building a project.json that has schema warnings (and other warnings), we are not writing the warnings to the console. This is a regression.

The fix is to add all diagnostic messages to the LibraryManager, which is responsible to hold all the diagnostic messages.

Fix 3021
This commit is contained in:
Eric Erhardt 2016-05-13 13:10:39 -05:00
parent e68a49e1d5
commit ecdb10591c
5 changed files with 63 additions and 2 deletions

View file

@ -0,0 +1,27 @@
// 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 FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
namespace Microsoft.DotNet.Tools.Builder.Tests
{
public class BuildWarningsTests : TestBase
{
[Fact]
public void HavingDeprecatedProjectFileProducesWarning()
{
var testInstance = TestAssetsManager.CreateTestInstance("TestLibraryWithDeprecatedProjectFile").WithLockFiles();
new BuildCommand(testInstance.TestRoot)
.ExecuteWithCapturedOutput()
.Should()
.Pass()
.And
.HaveStdErrContaining("DOTNET1015: The 'compilationOptions' option is deprecated. Use 'buildOptions' instead.")
.And
.HaveStdErrContaining("DOTNET1015: The 'packInclude' option is deprecated. Use 'files' in 'packOptions' instead.");
}
}
}