2016-02-10 16:14:06 +00:00
|
|
|
|
// 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";
|
|
|
|
|
|
2016-02-11 23:55:37 +00:00
|
|
|
|
public IncrementalTestsTransitiveRuntime()
|
2016-02-10 16:14:06 +00:00
|
|
|
|
{
|
2016-02-11 23:55:37 +00:00
|
|
|
|
MainProject = "TestLibrary2";
|
|
|
|
|
ExpectedOutput = "This string came from the test library!" + Environment.NewLine;
|
2016-02-10 16:14:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void TestSkipsRebuildWithTransitiveExeDependency()
|
|
|
|
|
{
|
2016-02-11 23:55:37 +00:00
|
|
|
|
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithTransitiveAppDependency")
|
|
|
|
|
.WithLockFiles();
|
|
|
|
|
TestProjectRoot = testInstance.TestRoot;
|
2016-02-10 16:14:06 +00:00
|
|
|
|
var buildResult = BuildProject();
|
2016-04-13 00:29:07 +00:00
|
|
|
|
buildResult.Should().HaveCompiledProject(MainProject, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveCompiledProject(TestLibraryWithAppDependency, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveCompiledProject(AppProject, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveCompiledProject(LibraryProject, _appFrameworkFullName);
|
2016-02-10 16:14:06 +00:00
|
|
|
|
|
|
|
|
|
buildResult = BuildProject();
|
|
|
|
|
|
2016-04-13 00:29:07 +00:00
|
|
|
|
buildResult.Should().HaveSkippedProjectCompilation(MainProject, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveSkippedProjectCompilation(TestLibraryWithAppDependency, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveSkippedProjectCompilation(AppProject, _appFrameworkFullName);
|
|
|
|
|
buildResult.Should().HaveSkippedProjectCompilation(LibraryProject, _appFrameworkFullName);
|
2016-02-10 16:14:06 +00:00
|
|
|
|
}
|
2016-02-11 23:55:37 +00:00
|
|
|
|
|
|
|
|
|
protected override string GetProjectDirectory(string projectName)
|
|
|
|
|
{
|
|
|
|
|
return Path.Combine(TestProjectRoot, projectName);
|
|
|
|
|
}
|
2016-02-10 16:14:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|