Skip to content

Commit

Permalink
Inline TestConstants.TEST_WORKSPACE_DIRECTORY.
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=90984191
  • Loading branch information
ulfjack authored and philwo committed Apr 14, 2015
1 parent 45a258f commit 969e04a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ protected ConfiguredTarget scratchConfiguredTarget(String packageName,
*/
protected Rule scratchRule(String packageName, String ruleName, String... lines)
throws Exception {
scratchFile("/" + TestConstants.TEST_WORKSPACE_DIRECTORY + "/" + packageName + "/BUILD", lines);
scratchFile(packageName + "/BUILD", lines);
return (Rule) getTarget("//" + packageName + ":" + ruleName);
}

Expand Down Expand Up @@ -745,9 +745,8 @@ protected Artifact getSourceArtifact(PathFragment rootRelativePath, Root root) {
return view.getArtifactFactory().getSourceArtifact(rootRelativePath, root);
}

protected Artifact getSourceArtifact(String name) throws IOException {
return getSourceArtifact(new PathFragment(name),
Root.asSourceRoot(scratch.dir("/" + TestConstants.TEST_WORKSPACE_DIRECTORY)));
protected Artifact getSourceArtifact(String name) {
return getSourceArtifact(new PathFragment(name), Root.asSourceRoot(rootDirectory));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected void setUp() throws Exception {
super.setUp();
scratch = new Scratch(createFileSystem());
outputBase = scratch.dir("/usr/local/google/_blaze_jrluser/FAKEMD5/");
rootDirectory = scratch.dir("/" + TestConstants.TEST_WORKSPACE_DIRECTORY);
rootDirectory = scratch.dir("/workspace");
scratchFile(rootDirectory.getRelative("WORKSPACE").getPathString(),
"bind(",
" name = 'objc_proto_lib',",
Expand Down Expand Up @@ -142,7 +142,7 @@ protected FileSystem scratchFS() {

private String workspaceRelative(String pathName) {
if (!pathName.startsWith("/")) {
return "/" + TestConstants.TEST_WORKSPACE_DIRECTORY + "/" + pathName;
return "/workspace/" + pathName;
}
return pathName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ private TestConstants() {
*/
public static final String JAVATESTS_ROOT = "src/test/java/";

/**
* The directory in InMemoryFileSystem where workspaces created during unit tests reside.
*/
public static final String TEST_WORKSPACE_DIRECTORY = "bazel";

public static final String TEST_RULE_CLASS_PROVIDER =
"com.google.devtools.build.lib.bazel.rules.BazelRuleClassProvider";
public static final ImmutableList<String> IGNORED_MESSAGE_PREFIXES = ImmutableList.<String>of();
Expand Down

0 comments on commit 969e04a

Please sign in to comment.