aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2015-09-13 02:03:26 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-09-14 15:39:28 +0000
commit7f24022ce943c58dc4049b5206e39ab37d10f8ee (patch)
treee729da65461699cc28fb0ea3b719af6d3c12b08d /src/test/java/com/google
parent15da9be94f3ff6771e38442f0bc8f1316faa4e47 (diff)
Use the file size from FileValue instead of wastefully stat'ing the file again in order to get the file size in ParserInputSource#create (used multiple times for each BUILD file and Skylark .bzl file).
-- MOS_MIGRATED_REVID=102930870
Diffstat (limited to 'src/test/java/com/google')
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
index 7068278951..02e1f8b2ce 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java
@@ -664,7 +664,11 @@ public abstract class BuildViewTestCase extends FoundationTestCase {
*/
protected Rule scratchRule(String packageName, String ruleName, String... lines)
throws Exception {
- scratch.file(packageName + "/BUILD", lines);
+ String buildFilePathString = packageName + "/BUILD";
+ scratch.file(buildFilePathString, lines);
+ skyframeExecutor.invalidateFilesUnderPathForTesting(
+ new ModifiedFileSet.Builder().modify(new PathFragment(buildFilePathString)).build(),
+ rootDirectory);
return (Rule) getTarget("//" + packageName + ":" + ruleName);
}