aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/bazel/skylark_repository_test.sh
diff options
context:
space:
mode:
authorGravatar brandjon <brandjon@google.com>2017-10-25 15:16:44 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-10-25 16:46:16 +0200
commit60fc02b96969e3ec056e2f599e89bc0291e02419 (patch)
tree6edd3db60e38e41653f821de4cde54cf07375ce8 /src/test/shell/bazel/skylark_repository_test.sh
parent81fc5414babeb5811f3dd2eded3a8037b0fd7038 (diff)
Split skylark flag tests into multiple test cases
This is cleaner and will help when we eventually add tests for flags controlling the global environment. RELNOTES: None PiperOrigin-RevId: 173388860
Diffstat (limited to 'src/test/shell/bazel/skylark_repository_test.sh')
-rwxr-xr-xsrc/test/shell/bazel/skylark_repository_test.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/test/shell/bazel/skylark_repository_test.sh b/src/test/shell/bazel/skylark_repository_test.sh
index 72c08bb8cf..61c1e223dc 100755
--- a/src/test/shell/bazel/skylark_repository_test.sh
+++ b/src/test/shell/bazel/skylark_repository_test.sh
@@ -24,8 +24,6 @@ source "${CURRENT_DIR}/../integration_test_setup.sh" \
source "${CURRENT_DIR}/remote_helpers.sh" \
|| { echo "remote_helpers.sh not found!" >&2; exit 1; }
-SKYLARK_FLAG_MARKER="<== skylark flag test ==>"
-
# Basic test.
function test_macro_local_repository() {
create_new_workspace
@@ -348,12 +346,22 @@ def _impl(repository_ctx):
repo = repository_rule(implementation=_impl, local=True)
EOF
+ MARKER="<== skylark flag test ==>"
+
+ bazel build @foo//:bar >& $TEST_log \
+ || fail "Expected build to succeed"
+ expect_log "In repo rule: " "Did not find repository rule print output"
+ expect_not_log "$MARKER" \
+ "Marker string '$MARKER' was seen even though \
+ --internal_skylark_flag_test_canary wasn't passed"
+
# Build with the special testing flag that appends a marker string to all
# print() calls.
bazel build @foo//:bar --internal_skylark_flag_test_canary >& $TEST_log \
|| fail "Expected build to succeed"
- expect_log "In repo rule: $SKYLARK_FLAG_MARKER" \
- "Skylark flags are not propagating to repository rules"
+ expect_log "In repo rule: $MARKER" \
+ "Skylark flags are not propagating to repository rule implementation \
+ function evaluation"
}
function test_skylark_repository_which_and_execute() {