diff options
author | 2015-11-17 17:07:48 +0000 | |
---|---|---|
committer | 2015-11-18 15:30:01 +0000 | |
commit | e65907205f4be1be04966967327152c6bfd42573 (patch) | |
tree | 6c1eb362ef04de1043c4ae96d070064077355fd0 /src/test/java | |
parent | 4bbde148a9e71f3116a8051bc6f5bf5d0521adf2 (diff) |
Allow for a set of known modified files to be passed into the FileSystemValueChecker when checking for dirty actions.
--
MOS_MIGRATED_REVID=108046467
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java index 2aed79a1ff..d1d2018eaf 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java @@ -38,6 +38,7 @@ import com.google.devtools.build.lib.vfs.FileStatus; import com.google.devtools.build.lib.vfs.FileStatusWithDigest; import com.google.devtools.build.lib.vfs.FileStatusWithDigestAdapter; import com.google.devtools.build.lib.vfs.FileSystemUtils; +import com.google.devtools.build.lib.vfs.ModifiedFileSet; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.RootedPath; @@ -337,14 +338,28 @@ public class FilesystemValueCheckerTest { .evaluate(ImmutableList.<SkyKey>of(), false, 1, NullEventHandler.INSTANCE) .hasError()); assertThat(new FilesystemValueChecker(tsgm, null).getDirtyActionValues(evaluator.getValues(), - batchStatter)).isEmpty(); + batchStatter, ModifiedFileSet.EVERYTHING_MODIFIED)).isEmpty(); FileSystemUtils.writeContentAsLatin1(out1.getPath(), "goodbye"); assertEquals( ActionExecutionValue.key(action1), Iterables.getOnlyElement( new FilesystemValueChecker(tsgm, null).getDirtyActionValues(evaluator.getValues(), - batchStatter))); + batchStatter, ModifiedFileSet.EVERYTHING_MODIFIED))); + assertEquals( + ActionExecutionValue.key(action1), + Iterables.getOnlyElement( + new FilesystemValueChecker(tsgm, null).getDirtyActionValues(evaluator.getValues(), + batchStatter, + new ModifiedFileSet.Builder().modify(out1.getExecPath()).build()))); + assertThat( + new FilesystemValueChecker(tsgm, null).getDirtyActionValues(evaluator.getValues(), + batchStatter, + new ModifiedFileSet.Builder().modify( + out1.getExecPath().getParentDirectory()).build())).isEmpty(); + assertThat( + new FilesystemValueChecker(tsgm, null).getDirtyActionValues(evaluator.getValues(), + batchStatter, ModifiedFileSet.NOTHING_MODIFIED)).isEmpty(); } private Artifact createDerivedArtifact(String relPath) throws IOException { |