Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Aug 8, 2023
1 parent 99f863f commit ee935e4
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/test/shell/integration/runfiles_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,15 @@ EOF

function test_manifest_action_reruns_on_output_base_change() {
CURRENT_DIRECTORY=$(pwd)
if $is_windows; then
CURRENT_DIRECTORY=$(cygpath -m "${CURRENT_DIRECTORY}")
fi

if $is_windows; then
MANIFEST_PATH=bazel-bin/hello_world.exe.runfiles_manifest
else
MANIFEST_PATH=bazel-bin/hello_world.runfiles_manifest
fi

OUTPUT_BASE="${CURRENT_DIRECTORY}/test/outputs/__main__"
TEST_FOLDER_1="${CURRENT_DIRECTORY}/test/test1"
Expand All @@ -451,30 +460,19 @@ echo "Hello World"
EOF
chmod +x hello_world.sh

cd "${TEST_FOLDER_2}"
touch WORKSPACE
cat > BUILD <<EOF
sh_binary(
name = "hello_world",
srcs = ["hello_world.sh"],
)
EOF
cat > hello_world.sh <<EOF
echo "Hello World"
EOF
chmod +x hello_world.sh
cp "${TEST_FOLDER_1}"/* "${TEST_FOLDER_2}/"

cd "${TEST_FOLDER_1}"
bazel --output_base="${OUTPUT_BASE}" build //...

assert_contains "${TEST_FOLDER_1}" bazel-bin/hello_world.runfiles_manifest
assert_not_contains "${TEST_FOLDER_2}" bazel-bin/hello_world.runfiles_manifest
assert_contains "${TEST_FOLDER_1}" "${MANIFEST_PATH}"
assert_not_contains "${TEST_FOLDER_2}" "${MANIFEST_PATH}"

cd "${TEST_FOLDER_2}"
bazel --output_base="${OUTPUT_BASE}" build //...

assert_not_contains "${TEST_FOLDER_1}" bazel-bin/hello_world.runfiles_manifest
assert_contains "${TEST_FOLDER_2}" bazel-bin/hello_world.runfiles_manifest
assert_not_contains "${TEST_FOLDER_1}" "${MANIFEST_PATH}"
assert_contains "${TEST_FOLDER_2}" "${MANIFEST_PATH}"
}

run_suite "runfiles"

0 comments on commit ee935e4

Please sign in to comment.