Skip to content

Commit

Permalink
Fix tests that overwrite the WORKSPACE.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 243857468
  • Loading branch information
katre authored and Copybara-Service committed Apr 16, 2019
1 parent 8ca57bf commit 0a1776d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/test/shell/integration/runfiles_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,8 @@ EOF
}

function test_workspace_name_change() {
cat > WORKSPACE <<EOF
workspace(name = "foo")
EOF
# Rewrite the workspace name but leave the rest of WORKSPACE alone.
sed -ie 's,workspace(.*,workspace(name = "foo"),' WORKSPACE

cat > BUILD <<EOF
cc_binary(
Expand All @@ -309,9 +308,8 @@ EOF
bazel build //:thing $EXTRA_BUILD_FLAGS &> $TEST_log || fail "Build failed"
[[ -d ${PRODUCT_NAME}-bin/thing${EXT}.runfiles/foo ]] || fail "foo not found"

cat > WORKSPACE <<EOF
workspace(name = "bar")
EOF
# Change workspace name to bar.
sed -ie 's,workspace(.*,workspace(name = "bar"),' WORKSPACE
bazel build //:thing $EXTRA_BUILD_FLAGS &> $TEST_log || fail "Build failed"
[[ -d ${PRODUCT_NAME}-bin/thing${EXT}.runfiles/bar ]] || fail "bar not found"
[[ ! -d ${PRODUCT_NAME}-bin/thing${EXT}.runfiles/foo ]] \
Expand Down

0 comments on commit 0a1776d

Please sign in to comment.