aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/shell')
-rwxr-xr-xsrc/test/shell/bazel/bazel_example_test.sh17
-rwxr-xr-xsrc/test/shell/bazel/bazel_rules_test.sh6
-rwxr-xr-xsrc/test/shell/bazel/bazel_sandboxing_test.sh2
-rwxr-xr-xsrc/test/shell/bazel/external_integration_test.sh12
-rwxr-xr-xsrc/test/shell/bazel/generate_workspace_test.sh2
-rwxr-xr-xsrc/test/shell/bazel/git_repository_test.sh8
-rwxr-xr-xsrc/test/shell/bazel/local_repository_test.sh2
-rwxr-xr-xsrc/test/shell/bazel/testenv.sh3
-rwxr-xr-xsrc/test/shell/integration/runfiles_test.sh7
9 files changed, 23 insertions, 36 deletions
diff --git a/src/test/shell/bazel/bazel_example_test.sh b/src/test/shell/bazel/bazel_example_test.sh
index b9d2aef276..93075fddb6 100755
--- a/src/test/shell/bazel/bazel_example_test.sh
+++ b/src/test/shell/bazel/bazel_example_test.sh
@@ -23,6 +23,9 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \
function set_up() {
copy_examples
+ cat > WORKSPACE <<EOF
+workspace(name = "io_bazel")
+EOF
}
#
@@ -77,20 +80,6 @@ function test_java_test_with_junitrunner() {
assert_test_ok "${java_native_tests}:custom_with_test_class"
}
-function test_java_test_with_workspace_name() {
- local java_pkg=examples/java-native/src/main/java/com/example/myproject
- # Use named workspace and test if we can still execute hello-world
- bazel clean
-
- rm -f WORKSPACE
- cat >WORKSPACE <<'EOF'
-workspace(name = "toto")
-EOF
-
- assert_build_output ./bazel-bin/${java_pkg}/hello-world ${java_pkg}:hello-world
- assert_binary_run_from_subdir "bazel-bin/${java_pkg}/hello-world foo" "Hello foo"
-}
-
function test_genrule_and_genquery() {
# The --javabase flag is to force the tools/jdk:jdk label to be used
# so it appears in the dependency list.
diff --git a/src/test/shell/bazel/bazel_rules_test.sh b/src/test/shell/bazel/bazel_rules_test.sh
index b0f7e4e312..c82b9cd996 100755
--- a/src/test/shell/bazel/bazel_rules_test.sh
+++ b/src/test/shell/bazel/bazel_rules_test.sh
@@ -63,7 +63,7 @@ function test_extra_action() {
# a program that parses the proto here.
cat > mypkg/echoer.sh <<EOF
#!/bin/bash
-if [[ ! -e \$0.runfiles/mypkg/runfile ]]; then
+if [[ ! -e \$0.runfiles/__main__/mypkg/runfile ]]; then
echo "Runfile not found" >&2
exit 1
fi
@@ -357,8 +357,8 @@ def Fib(n):
EOF
cat > module2/bez.py <<EOF
-from external.remote.module_a import foo
-from external.remote.module_b import bar
+from remote.module_a import foo
+from remote.module_b import bar
from module1 import fib
print "The number is %d" % foo.GetNumber()
diff --git a/src/test/shell/bazel/bazel_sandboxing_test.sh b/src/test/shell/bazel/bazel_sandboxing_test.sh
index 27097bc9c1..9e6bc857d8 100755
--- a/src/test/shell/bazel/bazel_sandboxing_test.sh
+++ b/src/test/shell/bazel/bazel_sandboxing_test.sh
@@ -164,7 +164,7 @@ EOF
#!/bin/sh
set -e
-cp $(dirname $0)/tool.runfiles/examples/genrule/datafile $1
+cp $(dirname $0)/tool.runfiles/__main__/examples/genrule/datafile $1
echo "Tools work!"
EOF
chmod +x examples/genrule/tool.sh
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index 6f3a6b03c0..e9c1bc6660 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -139,7 +139,7 @@ EOF
cat > zoo/female.sh <<EOF
#!/bin/bash
-./external/endangered/fox/male
+../endangered/fox/male
EOF
chmod +x zoo/female.sh
fi
@@ -422,10 +422,10 @@ EOF
cat > test/test.sh <<EOF
#!/bin/bash
echo "symlink:"
-ls -l external/toto/file
+ls -l ../toto/file
echo "dest:"
-ls -l \$(readlink -f external/toto/file/toto)
-external/toto/file/toto
+ls -l \$(readlink -f ../toto/file/toto)
+../toto/file/toto
EOF
chmod +x test/test.sh
@@ -459,7 +459,7 @@ EOF
cat > test/test.sh <<EOF
#!/bin/bash
-cat external/toto/file/toto
+cat ../toto/file/toto
EOF
chmod +x test/test.sh
@@ -581,7 +581,7 @@ EOF
cat > zoo/female.sh <<EOF
#!/bin/bash
-cat external/endangered/fox/male
+cat ../endangered/fox/male
EOF
chmod +x zoo/female.sh
diff --git a/src/test/shell/bazel/generate_workspace_test.sh b/src/test/shell/bazel/generate_workspace_test.sh
index 18168459c9..584f3e04d8 100755
--- a/src/test/shell/bazel/generate_workspace_test.sh
+++ b/src/test/shell/bazel/generate_workspace_test.sh
@@ -24,8 +24,6 @@ source $src_dir/test-setup.sh \
source $src_dir/remote_helpers.sh \
|| { echo "remote_helpers.sh not found!" >&2; exit 1; }
-export JAVA_RUNFILES=$TEST_SRCDIR
-
function set_up() {
# Set up custom repository directory.
m2=$TEST_TMPDIR/my-m2
diff --git a/src/test/shell/bazel/git_repository_test.sh b/src/test/shell/bazel/git_repository_test.sh
index 67a630dd1b..2c862b7f7e 100755
--- a/src/test/shell/bazel/git_repository_test.sh
+++ b/src/test/shell/bazel/git_repository_test.sh
@@ -85,7 +85,7 @@ EOF
cat > planets/planet_info.sh <<EOF
#!/bin/bash
-cat external/pluto/info
+cat ../pluto/info
EOF
chmod +x planets/planet_info.sh
@@ -171,7 +171,7 @@ EOF
cat > planets/planet_info.sh <<EOF
#!/bin/bash
-cat external/pluto/info
+cat ../pluto/info
EOF
chmod +x planets/planet_info.sh
@@ -246,8 +246,8 @@ EOF
cat > planets/planet_info.sh <<EOF
#!/bin/bash
-cat external/outer_planets/neptune/info
-cat external/outer_planets/pluto/info
+cat ../outer_planets/neptune/info
+cat ../outer_planets/pluto/info
EOF
chmod +x planets/planet_info.sh
diff --git a/src/test/shell/bazel/local_repository_test.sh b/src/test/shell/bazel/local_repository_test.sh
index 0fad9c95f0..70f9be6769 100755
--- a/src/test/shell/bazel/local_repository_test.sh
+++ b/src/test/shell/bazel/local_repository_test.sh
@@ -95,7 +95,7 @@ EOF
cat > zoo/dumper.sh <<EOF
#!/bin/bash
-cat external/pandas/red/baby-panda
+cat ../pandas/red/baby-panda
cat red/day-keeper
EOF
chmod +x zoo/dumper.sh
diff --git a/src/test/shell/bazel/testenv.sh b/src/test/shell/bazel/testenv.sh
index 14c39c0766..8820f93a6e 100755
--- a/src/test/shell/bazel/testenv.sh
+++ b/src/test/shell/bazel/testenv.sh
@@ -18,6 +18,7 @@
#
[ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; }
+TEST_SRCDIR="$TEST_SRCDIR/io_bazel"
# Load the unit-testing framework
source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \
@@ -29,7 +30,7 @@ bazel="${TEST_SRCDIR}/src/bazel"
bazel_data="${TEST_SRCDIR}"
# Java
-jdk_dir="${TEST_SRCDIR}/external/local_jdk"
+jdk_dir="${TEST_SRCDIR}/../local_jdk"
langtools="${TEST_SRCDIR}/src/test/shell/bazel/langtools.jar"
# Tools directory location
diff --git a/src/test/shell/integration/runfiles_test.sh b/src/test/shell/integration/runfiles_test.sh
index 6821b30dcd..ee26ca130c 100755
--- a/src/test/shell/integration/runfiles_test.sh
+++ b/src/test/shell/integration/runfiles_test.sh
@@ -55,16 +55,16 @@ EOF
bazel build pkg:py >&$TEST_log 2>&1 || fail "build failed"
# we get a warning that hidden.py is inaccessible
- expect_log_once "/genfiles/pkg/e/f/g/hidden.py obscured by pkg/e/f "
+ expect_log_once "/genfiles/pkg/e/f/g/hidden.py obscured by .*/pkg/e/f "
}
function test_foo_runfiles() {
-cat > BUILD << EOF
+ cat > BUILD << EOF
py_library(name = "root",
srcs = ["__init__.py"],
visibility = ["//visibility:public"])
EOF
-cat > pkg/BUILD << EOF
+ cat > pkg/BUILD << EOF
sh_binary(name = "foo",
srcs = [ "x/y/z.sh" ],
data = [ ":py",
@@ -149,4 +149,3 @@ EOF
}
run_suite "runfiles"
-