Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Test dependency stack is printed in query rdeps
Browse files Browse the repository at this point in the history
Summary: Just to be safe that dependency stacks are available in `buck query`.

Reviewed By: philipjameson

shipit-source-id: bf1d0629dc
  • Loading branch information
stepancheg authored and facebook-github-bot committed Oct 17, 2019
1 parent 29afa77 commit 5b33560
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/com/facebook/buck/cli/QueryCommandIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1725,4 +1725,19 @@ private static void assertContainsCycle(ProcessResult processResult, List<String
}
fail(stderr + " contained none of " + Joiner.on('\n').join(cycleCandidates));
}

@Test
public void dependencyStackInConfigurationsInRdeps() throws Exception {
ProjectWorkspace workspace =
TestDataHelper.createProjectWorkspaceForScenario(this, "query_command_configurations", tmp);
workspace.setUp();
ProcessResult result = workspace.runBuckCommand("query", "rdeps(set(//:b), set(//:c))");
result.assertFailure();
assertThat(
result.getStderr(),
containsIgnoringPlatformNewlines(
"Cannot use select() expression when target platform is not specified\n"
+ " At //:a\n"
+ " At //:b"));
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
constraint_setting(
name = "color",
)

constraint_value(
name = "red-c",
constraint_setting = ":color",
)

config_setting(
name = "red",
constraint_values = [
":red-c",
],
)

java_library(
name = "a",
compatible_with = [
":red",
],
deps = select({
":red": [],
"DEFAULT": [],
}),
)

java_library(
name = "b",
deps = [
":a",
],
)

java_library(
name = "c",
deps = [
":b",
],
)

0 comments on commit 5b33560

Please sign in to comment.