diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java | 2 | ||||
-rwxr-xr-x | src/test/shell/integration/experimental_ui_test.sh | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java index 824970a29c..234c03a490 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java @@ -20,6 +20,7 @@ import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.devtools.build.lib.Constants; +import com.google.devtools.build.lib.analysis.NoBuildEvent; import com.google.devtools.build.lib.collect.CompactHashSet; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.packages.Target; @@ -198,6 +199,7 @@ public final class QueryCommand implements BlazeCommand { } } + env.getEventBus().post(new NoBuildEvent()); if (!streamResults) { disableAnsiCharactersFiltering(env); output = new PrintStream(env.getReporter().getOutErr().getOutputStream()); diff --git a/src/test/shell/integration/experimental_ui_test.sh b/src/test/shell/integration/experimental_ui_test.sh index 07bdffc8de..deffba802a 100755 --- a/src/test/shell/integration/experimental_ui_test.sh +++ b/src/test/shell/integration/experimental_ui_test.sh @@ -82,4 +82,15 @@ function test_info_spacing() { || fail "bazel info output spaced as $BAZEL_INFO_OUTPUT" } +function test_query_spacing() { + # Verify that the output of "bazel query" is suitable for consumption by + # other tools, i.e., contains only result lines, separated only by newlines. + BAZEL_QUERY_OUTPUT=`bazel query --experimental_ui 'deps(//pkg:true)'` + echo "$BAZEL_QUERY_OUTPUT" | grep -q -v '^[@/]' \ + && fail "bazel query output is >$BAZEL_QUERY_OUTPUT<" + echo "$BAZEL_QUERY_OUTPUT" | grep -q $'\r' \ + && fail "bazel query output is >$BAZEL_QUERY_OUTPUT<" + true +} + run_suite "Integration tests for bazel's experimental UI" |