public void IncrementalBuildCopiesContentWhenOutputsDeletedWithLazyOutputMaterialization() { SetupTestState(); Configuration.Engine.DefaultFilter = @"output='" + Path.Combine(Configuration.Layout.ObjectDirectory.ToString(PathTable), "combined") + Path.DirectorySeparatorChar + "*'"; EagerCleanBuild("Build #1"); Paths buildPaths = GetBuildPaths(); File.Delete(buildPaths.CopyOfSourceFile1Path); File.Delete(buildPaths.FinalOutputPath); BuildCounters counters = Build("Build #2"); counters.VerifyNumberOfPipsExecuted(0); counters.VerifyNumberOfProcessPipsCached(TotalPips); counters.VerifyNumberOfCachedOutputsUpToDate(0); // Although CopyOfSourceFile1Path is deleted, since output materialization is lazy, the file is not materialized. counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs - 1); }
public void IncrementalBuildCopiesContentWhenOutputsDeleted() { SetupTestState(); EagerCleanBuild("Build #1"); Paths buildPaths = GetBuildPaths(); File.Delete(buildPaths.CopyOfSourceFile1Path); File.Delete(buildPaths.FinalOutputPath); Configuration.Schedule.EnableLazyOutputMaterialization = false; BuildCounters counters = Build("Build #2"); counters.VerifyNumberOfPipsExecuted(0); counters.VerifyNumberOfProcessPipsCached(TotalPips); counters.VerifyNumberOfCachedOutputsUpToDate(0); counters.VerifyNumberOfCachedOutputsCopied(TotalPipOutputs); // The next build should know that outputs are up to date, despite them having been re-deployed rather than re-computed last time. EagerBuildWithoutChanges("Build #3"); }