aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2016-07-13 17:00:59 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-07-14 11:12:43 +0000
commit08b0f7f676c730dd32e27dff3d90e63e4bf986e5 (patch)
treec9aa3897971fa59d97222d903cb0883ca6bbeb38 /src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java
parentd902d1568a2ec9c3af12a5f0b30ac4ee4fe9933e (diff)
Don't treat empty files specially with respect to mtime/digest.
RELNOTES: Bazel no longer regards an empty file as changed if its mtime has changed. -- MOS_MIGRATED_REVID=127328552
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java
index 55f1784c01..ea10d33a94 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/TimestampBuilderTest.java
@@ -169,8 +169,8 @@ public class TimestampBuilderTest extends TimestampBuilderTestCase {
buildArtifacts(cachingBuilder(), goodbye);
assertFalse(button.pressed); // not rebuilt
- // inMemoryMetadataCache.useFileDigest is false, so new timestamp is enough to force a rebuild.
- FileSystemUtils.touchFile(hello.getPath());
+ hello.getPath().setWritable(true);
+ FileSystemUtils.writeContentAsLatin1(hello.getPath(), "new content");
button.pressed = false;
buildArtifacts(cachingBuilder(), goodbye);
@@ -231,10 +231,10 @@ public class TimestampBuilderTest extends TimestampBuilderTestCase {
buildArtifacts(cachingBuilder(), hello);
assertFalse(button.pressed); // not rebuilt
- // Touching the *output* file 'hello' causes 'action' to re-execute, to
- // make things consistent again; this is not what Make would do, but it is
- // correct according to this Builder.
- BlazeTestUtils.changeModtime(hello.getPath());
+ // Changing the *output* file 'hello' causes 'action' to re-execute, to make things consistent
+ // again.
+ hello.getPath().setWritable(true);
+ FileSystemUtils.writeContentAsLatin1(hello.getPath(), "new content");
button.pressed = false;
buildArtifacts(cachingBuilder(), hello);
@@ -251,7 +251,8 @@ public class TimestampBuilderTest extends TimestampBuilderTestCase {
Artifact hello = createSourceArtifact("hello");
BlazeTestUtils.makeEmptyFile(hello.getPath());
Artifact wazuup = createDerivedArtifact("wazuup");
- Button button1 = createActionButton(Sets.newHashSet(hello), Sets.newHashSet(wazuup));
+ Button button1 = new Button();
+ registerAction(new CopyingAction(button1, hello, wazuup));
Artifact goodbye = createDerivedArtifact("goodbye");
Button button2 = createActionButton(Sets.newHashSet(wazuup), Sets.newHashSet(goodbye));
@@ -275,7 +276,8 @@ public class TimestampBuilderTest extends TimestampBuilderTestCase {
assertFalse(button1.pressed); // wazuup not rebuilt
assertFalse(button2.pressed); // goodbye not rebuilt
- FileSystemUtils.touchFile(hello.getPath());
+ hello.getPath().setWritable(true);
+ FileSystemUtils.writeContentAsLatin1(hello.getPath(), "new content");
button1.pressed = button2.pressed = false;
buildArtifacts(cachingBuilder(), goodbye);