Skip to content

Commit

Permalink
build_event_stream_test: simplify quoting
Browse files Browse the repository at this point in the history
...by quoting the delimiter of the here-documents, instead of the
documents themselves. This is possible as the here-documents are
constants in that test (not depending on the test setup).

Change-Id: If272060ce9f6384821e4bd0bd9033925bd1efe9c
PiperOrigin-RevId: 169080394
  • Loading branch information
aehlig authored and laszlocsomor committed Sep 18, 2017
1 parent e002c86 commit fdca2aa
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/shell/integration/build_event_stream_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ EOF
exit 1
EOF
chmod 755 pkg/false.sh
cat > pkg/slowtest.sh <<EOF
cat > pkg/slowtest.sh <<'EOF'
#!/bin/sh
sleep 1
exit 0
EOF
chmod 755 pkg/slowtest.sh
touch pkg/sourcefileA pkg/sourcefileB pkg/sourcefileC
cat > pkg/BUILD <<EOF
cat > pkg/BUILD <<'EOF'
exports_files(["somesourcefile"])
sh_test(
name = "true",
Expand Down Expand Up @@ -80,7 +80,7 @@ sh_test(
genrule(
name = "output_files_and_tags",
outs = ["out1.txt"],
cmd = "echo foo > \\"\$@\\"",
cmd = "echo foo > \"$@\"",
tags = ["tag1", "tag2"]
)
action_listener(
Expand All @@ -104,10 +104,10 @@ filegroup(
genrule(
name = "not_a_test",
outs = ["not_a_test.txt"],
cmd = "touch \$@",
cmd = "touch $@",
)
EOF
cat > simpleaspect.bzl <<EOF
cat > simpleaspect.bzl <<'EOF'
def _simple_aspect_impl(target, ctx):
for orig_out in ctx.rule.attr.outs:
aspect_out = ctx.actions.declare_file(orig_out.name + ".aspect")
Expand All @@ -119,7 +119,7 @@ def _simple_aspect_impl(target, ctx):
simple_aspect = aspect(implementation=_simple_aspect_impl)
EOF
cat > failingaspect.bzl <<EOF
cat > failingaspect.bzl <<'EOF'
def _failing_aspect_impl(target, ctx):
for orig_out in ctx.rule.attr.outs:
aspect_out = ctx.actions.declare_file(orig_out.name + ".aspect")
Expand All @@ -134,25 +134,25 @@ def _failing_aspect_impl(target, ctx):
failing_aspect = aspect(implementation=_failing_aspect_impl)
EOF
touch BUILD
cat > sample_workspace_status <<EOF
cat > sample_workspace_status <<'EOF'
#!/bin/sh
echo SAMPLE_WORKSPACE_STATUS workspace_status_value
EOF
chmod 755 sample_workspace_status
mkdir -p visibility/hidden
cat > visibility/hidden/BUILD <<EOF
cat > visibility/hidden/BUILD <<'EOF'
genrule(
name = "hello",
outs = ["hello.txt"],
cmd = "echo Hello World > \$@",
cmd = "echo Hello World > $@",
)
EOF
cat > visibility/BUILD <<EOF
cat > visibility/BUILD <<'EOF'
genrule(
name = "cannotsee",
outs = ["cannotsee.txt"],
srcs = ["//visibility/hidden:hello"],
cmd = "cp \$< \$@",
cmd = "cp $< $@",
)
EOF
mkdir -p failingtool
Expand Down

0 comments on commit fdca2aa

Please sign in to comment.