Do not search for runtime output in dependencies
This commit is contained in:
parent
23b1b077dd
commit
4462dc21f8
9 changed files with 124 additions and 12 deletions
|
@ -16,15 +16,16 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
|||
|
||||
protected readonly string MainProject;
|
||||
protected readonly string ExpectedOutput;
|
||||
protected readonly TempDirectory Root;
|
||||
|
||||
public IncrementalTestBase(string testProjectsRoot, string mainProject, string expectedOutput)
|
||||
{
|
||||
MainProject = mainProject;
|
||||
ExpectedOutput = expectedOutput;
|
||||
|
||||
var root = Temp.CreateDirectory();
|
||||
Root = Temp.CreateDirectory();
|
||||
|
||||
TempProjectRoot = root.CopyDirectory(testProjectsRoot);
|
||||
TempProjectRoot = Root.CopyDirectory(testProjectsRoot);
|
||||
}
|
||||
|
||||
protected void TouchSourcesOfProject()
|
||||
|
|
44
test/dotnet-build.Tests/IncrementalTestsTransitiveRuntime.cs
Normal file
44
test/dotnet-build.Tests/IncrementalTestsTransitiveRuntime.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// 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;
|
||||
using System.IO;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||
{
|
||||
public class IncrementalTestsTransitiveRuntime : IncrementalTestBase
|
||||
{
|
||||
private const string TestLibraryWithAppDependency = "TestLibraryWithAppDependency";
|
||||
private const string LibraryProject = "TestLibrary";
|
||||
private const string AppProject = "TestApp";
|
||||
|
||||
public IncrementalTestsTransitiveRuntime() : base(
|
||||
Path.Combine(AppContext.BaseDirectory, "TestAssets", "TestProjects", "TestAppWithTransitiveAppDependency"),
|
||||
"TestAppWithTransitiveAppDependency",
|
||||
"This string came from the test library!" + Environment.NewLine)
|
||||
{
|
||||
Root.CopyDirectory(Path.Combine(AppContext.BaseDirectory, "TestAssets", "TestProjects", LibraryProject));
|
||||
Root.CopyDirectory(Path.Combine(AppContext.BaseDirectory, "TestAssets", "TestProjects", AppProject));
|
||||
Root.CopyDirectory(Path.Combine(AppContext.BaseDirectory, "TestAssets", "TestProjects", TestLibraryWithAppDependency));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestSkipsRebuildWithTransitiveExeDependency()
|
||||
{
|
||||
var buildResult = BuildProject();
|
||||
buildResult.Should().HaveCompiledProject(MainProject);
|
||||
buildResult.Should().HaveCompiledProject(TestLibraryWithAppDependency);
|
||||
buildResult.Should().HaveCompiledProject(AppProject);
|
||||
buildResult.Should().HaveCompiledProject(LibraryProject);
|
||||
|
||||
buildResult = BuildProject();
|
||||
|
||||
buildResult.Should().HaveSkippedProjectCompilation(MainProject);
|
||||
buildResult.Should().HaveSkippedProjectCompilation(TestLibraryWithAppDependency);
|
||||
buildResult.Should().HaveSkippedProjectCompilation(AppProject);
|
||||
buildResult.Should().HaveSkippedProjectCompilation(LibraryProject);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -27,6 +27,8 @@
|
|||
"../../TestAssets/TestProjects/TestProjectToProjectDependencies/**/*",
|
||||
"../../TestAssets/TestProjects/TestProjectWithCultureSpecificResource/**/*",
|
||||
"../../TestAssets/TestProjects/TestProjectWithResource/**/*",
|
||||
"../../TestAssets/TestProjects/TestLibraryWithAppDependency/**/*",
|
||||
"../../TestAssets/TestProjects/TestAppWithTransitiveAppDependency/**/*",
|
||||
"../../TestAssets/TestProjects/global.json"
|
||||
],
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue