aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/external_integration_test.sh57
1 files changed, 35 insertions, 22 deletions
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index 21d5c0dcf4..c37200c6e5 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -510,6 +510,14 @@ function test_new_remote_repo_with_build_file_content() {
do_new_remote_repo_test "build_file_content"
}
+function test_new_remote_repo_with_workspace_file() {
+ do_new_remote_repo_test "workspace_file"
+}
+
+function test_new_remote_repo_with_workspace_file_content() {
+ do_new_remote_repo_test "workspace_file_content"
+}
+
function do_new_remote_repo_test() {
# Create a zipped-up repository HTTP response.
local repo2=$TEST_TMPDIR/repo2
@@ -526,38 +534,43 @@ function do_new_remote_repo_test() {
cd ${WORKSPACE_DIR}
- if [ "$1" = "build_file" ] ; then
- cat > fox.BUILD <<EOF
+ # Create the build file for the http archive based on the requested attr style.
+ local build_file_attr=""
+ local workspace_file_attr=""
+
+ local build_file_content="
filegroup(
- name = "fox",
- srcs = ["fox/male"],
- visibility = ["//visibility:public"],
+ name = \"fox\",
+ srcs = [\"fox/male\"],
+ visibility = [\"//visibility:public\"],
)
-EOF
+ "
- cat > WORKSPACE <<EOF
-new_http_archive(
- name = 'endangered',
- url = 'http://localhost:$nc_port/repo.zip',
- sha256 = '$sha256',
- build_file = 'fox.BUILD'
-)
-EOF
+ if [ "$1" = "build_file" ] ; then
+ echo ${build_file_content} > fox.BUILD
+ build_file_attr="build_file = 'fox.BUILD'"
else
- cat > WORKSPACE <<EOF
+ build_file_attr="build_file_content=\"\"\"${build_file_content}\"\"\""
+ fi
+
+ if [ "$1" = "workspace_file" ]; then
+ cat > fox.WORKSPACE <<EOF
+workspace(name="endangered-fox")
+EOF
+ workspace_file_attr="workspace_file = 'fox.WORKSPACE'"
+ elif [ "$1" = "workspace_file_content" ]; then
+ workspace_file_attr="workspace_file_content = 'workspace(name=\"endangered-fox\")'"
+ fi
+
+ cat > WORKSPACE <<EOF
new_http_archive(
name = 'endangered',
url = 'http://localhost:$nc_port/repo.zip',
sha256 = '$sha256',
- build_file_content = """
-filegroup(
- name = "fox",
- srcs = ["fox/male"],
- visibility = ["//visibility:public"],
-)"""
+ ${build_file_attr},
+ ${workspace_file_attr}
)
EOF
- fi
mkdir -p zoo
cat > zoo/BUILD <<EOF