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

Commit 5b33560

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Test dependency stack is printed in query rdeps
Summary: Just to be safe that dependency stacks are available in `buck query`. Reviewed By: philipjameson shipit-source-id: bf1d0629dc
1 parent 29afa77 commit 5b33560

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

test/com/facebook/buck/cli/QueryCommandIntegrationTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,4 +1725,19 @@ private static void assertContainsCycle(ProcessResult processResult, List<String
17251725
}
17261726
fail(stderr + " contained none of " + Joiner.on('\n').join(cycleCandidates));
17271727
}
1728+
1729+
@Test
1730+
public void dependencyStackInConfigurationsInRdeps() throws Exception {
1731+
ProjectWorkspace workspace =
1732+
TestDataHelper.createProjectWorkspaceForScenario(this, "query_command_configurations", tmp);
1733+
workspace.setUp();
1734+
ProcessResult result = workspace.runBuckCommand("query", "rdeps(set(//:b), set(//:c))");
1735+
result.assertFailure();
1736+
assertThat(
1737+
result.getStderr(),
1738+
containsIgnoringPlatformNewlines(
1739+
"Cannot use select() expression when target platform is not specified\n"
1740+
+ " At //:a\n"
1741+
+ " At //:b"));
1742+
}
17281743
}

test/com/facebook/buck/cli/testdata/query_command_configurations/.buckconfig

Whitespace-only changes.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
constraint_setting(
2+
name = "color",
3+
)
4+
5+
constraint_value(
6+
name = "red-c",
7+
constraint_setting = ":color",
8+
)
9+
10+
config_setting(
11+
name = "red",
12+
constraint_values = [
13+
":red-c",
14+
],
15+
)
16+
17+
java_library(
18+
name = "a",
19+
compatible_with = [
20+
":red",
21+
],
22+
deps = select({
23+
":red": [],
24+
"DEFAULT": [],
25+
}),
26+
)
27+
28+
java_library(
29+
name = "b",
30+
deps = [
31+
":a",
32+
],
33+
)
34+
35+
java_library(
36+
name = "c",
37+
deps = [
38+
":b",
39+
],
40+
)

0 commit comments

Comments
 (0)