aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
authorGravatar twerth <twerth@google.com>2018-08-02 07:30:30 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-02 07:31:54 -0700
commitf621bbe84e8c2bff47d8d060f28be2a8b5bae834 (patch)
tree280e9ae5b9b73c17c4269a76ba330fb253c2e030 /src/test/shell
parentf32aa9a7de90a268a468c60500c8bb178fd3ce9f (diff)
Add text output to aquery.
RELNOTES[NEW]: The aquery command now supports --output=text. PiperOrigin-RevId: 207096607
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/integration/aquery_test.sh32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/test/shell/integration/aquery_test.sh b/src/test/shell/integration/aquery_test.sh
index 735967a1ce..e21f0c48fe 100755
--- a/src/test/shell/integration/aquery_test.sh
+++ b/src/test/shell/integration/aquery_test.sh
@@ -45,9 +45,39 @@ EOF
assert_contains "//$pkg:foo" output
assert_not_contains "//$pkg:bar" output
- bazel aquery "deps(//$pkg:foo)" > output 2> "$TEST_log" || fail "Expected success"
+ bazel aquery "deps(//$pkg:foo)" > output 2> "$TEST_log" \
+ || fail "Expected success"
assert_contains "//$pkg:foo" output
assert_contains "//$pkg:bar" output
}
+function test_aquery_text() {
+ local pkg="${FUNCNAME[0]}"
+ mkdir -p "$pkg" || fail "mkdir -p $pkg"
+ cat > "$pkg/BUILD" <<'EOF'
+genrule(
+ name = "bar",
+ srcs = ["dummy.txt"],
+ outs = ["bar_out.txt"],
+ cmd = "echo unused > $(OUTS)",
+)
+EOF
+ echo "hello aquery" > "$pkg/in.txt"
+
+ bazel aquery --output=text "//$pkg:bar" > output 2> "$TEST_log" \
+ || fail "Expected success"
+ cat output >> "$TEST_log"
+ assert_contains "action 'Executing genrule //$pkg:bar'" output
+ assert_contains "Mnemonic: Genrule" output
+ assert_contains "Owner: //$pkg:bar" output
+ assert_contains "Configuration: .*-fastbuild" output
+ # Only check that the inputs/outputs/command line/environment exist, but not
+ # their actual contents since that would be too much.
+ assert_contains "Inputs: \[" output
+ assert_contains "Outputs: \[" output
+ assert_contains "Command Line: (" output
+ assert_contains "Environment: \[" output
+
+}
+
run_suite "${PRODUCT_NAME} action graph query tests"