Adding a runtimeconfig.dev.json containing the additionalProbePaths when doing dotnet build.
This commit is contained in:
parent
8ea93db89d
commit
f9bbdca531
6 changed files with 199 additions and 19 deletions
50
test/dotnet-build.Tests/BuildStandAloneTests.cs
Normal file
50
test/dotnet-build.Tests/BuildStandAloneTests.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
// 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 System.IO;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Microsoft.DotNet.ProjectModel;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Xunit;
|
||||
using System.Linq;
|
||||
using Microsoft.DotNet.TestFramework;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||
{
|
||||
public class BuildStandAloneTests : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void BuildingAStandAloneProjectProducesARuntimeConfigDevJsonFile()
|
||||
{
|
||||
var testInstance = TestAssetsManager.CreateTestInstance("PortableTests")
|
||||
.WithLockFiles();
|
||||
|
||||
var netstandardappOutput = Build(testInstance);
|
||||
|
||||
netstandardappOutput.Should().Exist().And.HaveFile("StandaloneApp.runtimeconfig.dev.json");
|
||||
}
|
||||
|
||||
public DirectoryInfo Build(TestInstance testInstance)
|
||||
{
|
||||
var projectPath = Path.Combine(testInstance.TestRoot, "StandaloneApp");
|
||||
|
||||
var result = new BuildCommand(
|
||||
projectPath: projectPath)
|
||||
.ExecuteWithCapturedOutput();
|
||||
|
||||
var contexts = ProjectContext.CreateContextForEachFramework(
|
||||
projectPath,
|
||||
null,
|
||||
PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers());
|
||||
|
||||
var runtime = contexts.FirstOrDefault(c => !string.IsNullOrEmpty(c.RuntimeIdentifier))?.RuntimeIdentifier;
|
||||
|
||||
result.Should().Pass();
|
||||
|
||||
var outputBase = new DirectoryInfo(
|
||||
Path.Combine(testInstance.TestRoot, "StandaloneApp", "bin", "Debug", "netstandardapp1.5"));
|
||||
|
||||
return outputBase.Sub(runtime);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue