diff options
21 files changed, 83 insertions, 91 deletions
@@ -1,3 +1,5 @@ +workspace(name = "io_bazel") + load("/tools/build_defs/jsonnet/jsonnet", "jsonnet_repositories") load("/tools/build_rules/rust/rust", "rust_repositories") diff --git a/examples/java-skylark/src/main/java/com/example/myproject/Greeter.java b/examples/java-skylark/src/main/java/com/example/myproject/Greeter.java index b4d8516dc9..143a71dfd4 100644 --- a/examples/java-skylark/src/main/java/com/example/myproject/Greeter.java +++ b/examples/java-skylark/src/main/java/com/example/myproject/Greeter.java @@ -29,7 +29,8 @@ public class Greeter { public void hello(String obj) throws Exception { String greeting = "Hello"; try { - String greetFile = getRunfiles() + "/examples/java-skylark/src/main/resources/greeting.txt"; + String greetFile = getRunfiles() + + "/io_bazel/examples/java-skylark/src/main/resources/greeting.txt"; greeting = convertStreamToString(new FileInputStream(greetFile)); } catch (FileNotFoundException e) { // use default. diff --git a/examples/shell/bin.sh b/examples/shell/bin.sh index 02345b0157..5b51ccf06c 100755 --- a/examples/shell/bin.sh +++ b/examples/shell/bin.sh @@ -18,9 +18,8 @@ set -eu # This allows the script to be both a binary and a library script. If our binary has defined # RUNFILES then we use it, otherwise we look for our own runfiles. -RUNFILES=${RUNFILES:-$0.runfiles} +RUNFILES=${RUNFILES:-$0.runfiles/io_bazel} source "${RUNFILES}/examples/shell/lib.sh" showfile - diff --git a/examples/shell/lib.sh b/examples/shell/lib.sh index 979a2c6b67..495ef3d422 100755 --- a/examples/shell/lib.sh +++ b/examples/shell/lib.sh @@ -18,9 +18,8 @@ set -eu # This allows the script to be both a binary and a library script. If our binary has defined # RUNFILES then we use it, otherwise we look for our own runfiles. -RUNFILES=${RUNFILES:-$0.runfiles} +RUNFILES=${RUNFILES:-$0.runfiles/io_bazel} function showfile { cat "${RUNFILES}/examples/shell/data/file.txt" } - diff --git a/scripts/bash_completion_test.sh b/scripts/bash_completion_test.sh index 3eed6fbc86..82a0fa3411 100755 --- a/scripts/bash_completion_test.sh +++ b/scripts/bash_completion_test.sh @@ -23,7 +23,7 @@ source ${DIR}/testenv.sh || { echo "testenv.sh not found!" >&2; exit 1; } : ${COMMAND_ALIASES:=bazel} # Completion script -: ${COMPLETION:="$TEST_SRCDIR/scripts/bazel-complete.bash"} +: ${COMPLETION:="$TEST_SRCDIR/io_bazel/scripts/bazel-complete.bash"} # Set this to test completion with package path (if enabled) : ${PACKAGE_PATH_PREFIX:=} diff --git a/scripts/release/testenv.sh b/scripts/release/testenv.sh index e5debf24e1..f11c8ab771 100755 --- a/scripts/release/testenv.sh +++ b/scripts/release/testenv.sh @@ -19,7 +19,7 @@ [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } # Load the unit-testing framework -source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ +source "${TEST_SRCDIR}/io_bazel/src/test/shell/unittest.bash" || \ { echo "Failed to source unittest.bash" >&2; exit 1; } # Commit at which we cut the master to do the test so we always take the git @@ -29,7 +29,7 @@ source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ # Set-up a copy of the git repository in ${MASTER_ROOT}, pointing master # to ${MASTER_COMMIT}. function setup_git_repository() { - local origin_git_root=${TEST_SRCDIR} + local origin_git_root=${TEST_SRCDIR}/io_bazel MASTER_ROOT=${TEST_TMPDIR}/git/root local orig_dir=${PWD} # Create a new origin with the good starting point diff --git a/scripts/testenv.sh b/scripts/testenv.sh index c45ee6a5e5..25fa4ebfd7 100755 --- a/scripts/testenv.sh +++ b/scripts/testenv.sh @@ -19,8 +19,8 @@ [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } # Load the unit-testing framework -source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ - { echo "Failed to source unittest.bash" >&2; exit 1; } +source "${TEST_SRCDIR}/io_bazel/src/test/shell/unittest.bash" \ + || { echo "Failed to source unittest.bash" >&2; exit 1; } set_up() { mkdir -p $TEST_TMPDIR/workspace diff --git a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD index 22929e225a..790cfbc068 100644 --- a/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD +++ b/src/java_tools/buildjar/java/com/google/devtools/build/java/bazel/BUILD @@ -14,6 +14,7 @@ genrule( outs = ["JavacBootclasspathLocations.java"], cmd = """ declare -a paths=($(SRCS)) && paths=($${paths[@]#$(GENDIR)/}) && +paths=($$(echo $${paths[@]} | sed s_external/__g)) && IFS=: && cat > $@ <<EOF package com.google.devtools.build.java.bazel; @@ -44,7 +45,7 @@ genrule( srcs = ["//third_party/java/jdk/langtools:javac_jar"], outs = ["JavaLangtoolsLocation.java"], cmd = """ -path=$(SRCS) && path=$${path#$(GENDIR)/} && +path=$(SRCS) && path=$${path#$(GENDIR)/} && path="io_bazel/$${path}" && cat > $@ <<EOF package com.google.devtools.build.java.bazel; public class JavaLangtoolsLocation { diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java b/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java index 537890467e..98540d248a 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java @@ -236,6 +236,13 @@ public final class RunfilesSupport { } /** + * Returns the name of the workspace that the build is occurring in. + */ + public PathFragment getWorkspaceName() { + return runfiles.getSuffix(); + } + + /** * Returns the middleman artifact that depends on getExecutable(), * getRunfilesManifest(), and getRunfilesSymlinkTargets(). Anything which * needs to actually run the executable should depend on this. diff --git a/src/test/java/com/google/devtools/build/lib/analysis/RunfilesSupplierImplTest.java b/src/test/java/com/google/devtools/build/lib/analysis/RunfilesSupplierImplTest.java index 8626f6913e..70024c460e 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/RunfilesSupplierImplTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/RunfilesSupplierImplTest.java @@ -86,7 +86,7 @@ public class RunfilesSupplierImplTest { } private static Runfiles mkRunfiles(Iterable<Artifact> artifacts) { - return new Runfiles.Builder("TESTING").addArtifacts(artifacts).build(); + return new Runfiles.Builder("TESTING", false).addArtifacts(artifacts).build(); } private static List<Artifact> mkArtifacts(Root rootDir, String... paths) { diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockToolsConfig.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockToolsConfig.java index 6207fde742..8b57ff53dc 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockToolsConfig.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockToolsConfig.java @@ -123,12 +123,12 @@ public final class MockToolsConfig { */ public void linkTool(String relativePath, String dest) throws IOException { Preconditions.checkState(realFileSystem); - Path target = runfilesDirectory.getRelative(TestConstants.RUNFILES_PREFIX + "/" + relativePath); + Path target = runfilesDirectory.getRelative(TestConstants.WORKSPACE_NAME + "/" + relativePath); if (!target.exists()) { // In some cases we run tests in a special client with a ../READONLY/ path where we may also // find the runfiles. Try that, too. Path readOnlyClientPath = rootDirectory.getRelative( - "../READONLY/" + TestConstants.RUNFILES_PREFIX + "/" + relativePath); + "../READONLY/" + TestConstants.WORKSPACE_NAME + "/" + relativePath); if (!readOnlyClientPath.exists()) { throw new IOException("target does not exist " + target); } else { diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java index 6d4fb51bef..a14172f55c 100644 --- a/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java +++ b/src/test/java/com/google/devtools/build/lib/testutil/TestConstants.java @@ -38,12 +38,7 @@ public class TestConstants { * Location in the bazel repo where embedded binaries come from. */ public static final ImmutableList<String> EMBEDDED_SCRIPTS_PATHS = ImmutableList.of( - "src/main/tools"); - - /** - * Path within runfiles tree for finding everything else. - */ - public static final String RUNFILES_PREFIX = "DOES-NOT-WORK-YET"; + "io_bazel/src/main/tools"); /** * Default workspace name. @@ -59,7 +54,7 @@ public class TestConstants { /** * Directory where we can find bazel's Java tests, relative to a test's runfiles directory. */ - public static final String JAVATESTS_ROOT = "src/test/java/"; + public static final String JAVATESTS_ROOT = "io_bazel/src/test/java/"; public static final String TEST_RULE_CLASS_PROVIDER = "com.google.devtools.build.lib.bazel.rules.BazelRuleClassProvider"; diff --git a/src/test/shell/bazel/android/android_integration_test.sh b/src/test/shell/bazel/android/android_integration_test.sh index 1a65c31025..1aa77f4bad 100755 --- a/src/test/shell/bazel/android/android_integration_test.sh +++ b/src/test/shell/bazel/android/android_integration_test.sh @@ -158,12 +158,12 @@ EOF bazel build -s //java/bazel:bin || fail "build failed" } -if [[ ! -r "${TEST_SRCDIR}/external/androidndk/ndk/RELEASE.TXT" ]]; then +if [[ ! -r "${BAZEL_RUNFILES}/external/androidndk/ndk/RELEASE.TXT" ]]; then echo "Not running Android tests due to lack of an Android NDK." exit 0 fi -if [[ ! -r "${TEST_SRCDIR}/external/androidsdk/SDK Readme.txt" ]]; then +if [[ ! -r "${BAZEL_RUNFILES}/external/androidsdk/SDK Readme.txt" ]]; then echo "Not running Android tests due to lack of an Android SDK." exit 0 fi 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_worker_test.sh b/src/test/shell/bazel/bazel_worker_test.sh index 61ee9eafc4..8ad58c8e68 100755 --- a/src/test/shell/bazel/bazel_worker_test.sh +++ b/src/test/shell/bazel/bazel_worker_test.sh @@ -24,7 +24,7 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \ # TODO(philwo): Change this so the path to the custom worker gets passed in as an argument to the # test, once the bug that makes using the "args" attribute with sh_tests in Bazel impossible is # fixed. -example_worker=$(find $TEST_SRCDIR -name ExampleWorker_deploy.jar) +example_worker=$(find $BAZEL_RUNFILES -name ExampleWorker_deploy.jar) function set_up() { bazel build --worker_quit_after_build 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/test-setup.sh b/src/test/shell/bazel/test-setup.sh index e13332420f..a8b0e77bd1 100755 --- a/src/test/shell/bazel/test-setup.sh +++ b/src/test/shell/bazel/test-setup.sh @@ -66,8 +66,8 @@ function setup_android_support() { # TODO(bazel-team): This hard-codes the name of the Android repository in # the WORKSPACE file of Bazel. Change this once external repositories have # their own defined names under which they are mounted. - NDK_SRCDIR=$TEST_SRCDIR/external/androidndk/ndk - SDK_SRCDIR=$TEST_SRCDIR/external/androidsdk + NDK_SRCDIR=$BAZEL_RUNFILES/external/androidndk/ndk + SDK_SRCDIR=$BAZEL_RUNFILES/external/androidsdk mkdir -p $ANDROID_NDK mkdir -p $ANDROID_SDK diff --git a/src/test/shell/bazel/testenv.sh b/src/test/shell/bazel/testenv.sh index 3e00e57c79..30ee820d4f 100755 --- a/src/test/shell/bazel/testenv.sh +++ b/src/test/shell/bazel/testenv.sh @@ -18,65 +18,66 @@ # [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } +BAZEL_RUNFILES="$TEST_SRCDIR/io_bazel" # Load the unit-testing framework -source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ +source "${BAZEL_RUNFILES}/src/test/shell/unittest.bash" || \ { echo "Failed to source unittest.bash" >&2; exit 1; } # WORKSPACE file -workspace_file="${TEST_SRCDIR}/WORKSPACE" +workspace_file="${BAZEL_RUNFILES}/WORKSPACE" # Bazel -bazel_tree="${TEST_SRCDIR}/src/test/shell/bazel/doc-srcs.zip" -bazel="${TEST_SRCDIR}/src/bazel" -bazel_data="${TEST_SRCDIR}" +bazel_tree="${BAZEL_RUNFILES}/src/test/shell/bazel/doc-srcs.zip" +bazel="${BAZEL_RUNFILES}/src/bazel" +bazel_data="${BAZEL_RUNFILES}" # Java -jdk_dir="${TEST_SRCDIR}/external/local_jdk" -langtools="${TEST_SRCDIR}/src/test/shell/bazel/langtools.jar" +jdk_dir="${BAZEL_RUNFILES}/external/local_jdk" +langtools="${BAZEL_RUNFILES}/src/test/shell/bazel/langtools.jar" # Tools directory location -tools_dir="${TEST_SRCDIR}/tools" -langtools_dir="${TEST_SRCDIR}/third_party/java/jdk/langtools" +tools_dir="${BAZEL_RUNFILES}/tools" +langtools_dir="${BAZEL_RUNFILES}/third_party/java/jdk/langtools" EXTRA_BAZELRC="build --ios_sdk_version=8.4" # Java tooling -javabuilder_path="$(find ${TEST_SRCDIR} -name JavaBuilder_*.jar)" -langtools_path="${TEST_SRCDIR}/third_party/java/jdk/langtools/javac.jar" -singlejar_path="${TEST_SRCDIR}/src/java_tools/singlejar/SingleJar_deploy.jar" -genclass_path="${TEST_SRCDIR}/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/GenClass_deploy.jar" -junitrunner_path="${TEST_SRCDIR}/src/java_tools/junitrunner/java/com/google/testing/junit/runner/Runner_deploy.jar" -ijar_path="${TEST_SRCDIR}/third_party/ijar/ijar" +javabuilder_path="$(find ${BAZEL_RUNFILES} -name JavaBuilder_*.jar)" +langtools_path="${BAZEL_RUNFILES}/third_party/java/jdk/langtools/javac.jar" +singlejar_path="${BAZEL_RUNFILES}/src/java_tools/singlejar/SingleJar_deploy.jar" +genclass_path="${BAZEL_RUNFILES}/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass/GenClass_deploy.jar" +junitrunner_path="${BAZEL_RUNFILES}/src/java_tools/junitrunner/java/com/google/testing/junit/runner/Runner_deploy.jar" +ijar_path="${BAZEL_RUNFILES}/third_party/ijar/ijar" # Sandbox tools -process_wrapper="${TEST_SRCDIR}/src/main/tools/process-wrapper" -namespace_sandbox="${TEST_SRCDIR}/src/main/tools/namespace-sandbox" +process_wrapper="${BAZEL_RUNFILES}/src/main/tools/process-wrapper" +namespace_sandbox="${BAZEL_RUNFILES}/src/main/tools/namespace-sandbox" # Android tooling -aargenerator_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/AarGeneratorAction_deploy.jar" -androidresourceprocessor_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction_deploy.jar" -resourceshrinker_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction_deploy.jar" -dexmapper_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/ziputils/mapper_deploy.jar" -dexreducer_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/ziputils/reducer_deploy.jar" -incrementaldeployment_path="${TEST_SRCDIR}/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment" +aargenerator_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/AarGeneratorAction_deploy.jar" +androidresourceprocessor_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/AndroidResourceProcessingAction_deploy.jar" +resourceshrinker_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/ResourceShrinkerAction_deploy.jar" +dexmapper_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/ziputils/mapper_deploy.jar" +dexreducer_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/ziputils/reducer_deploy.jar" +incrementaldeployment_path="${BAZEL_RUNFILES}/src/tools/android/java/com/google/devtools/build/android/incrementaldeployment" # iOS and Objective-C tooling -iossim_path="${TEST_SRCDIR}/third_party/iossim/iossim" -actoolwrapper_path="${TEST_SRCDIR}/src/tools/xcode/actoolwrapper/actoolwrapper.sh" -ibtoolwrapper_path="${TEST_SRCDIR}/src/tools/xcode/ibtoolwrapper/ibtoolwrapper.sh" -swiftstdlibtoolwrapper_path="${TEST_SRCDIR}/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh" -momcwrapper_path="${TEST_SRCDIR}/src/tools/xcode/momcwrapper/momcwrapper.sh" -bundlemerge_path="${TEST_SRCDIR}/src/objc_tools/bundlemerge/bundlemerge_deploy.jar" -plmerge_path="${TEST_SRCDIR}/src/objc_tools/plmerge/plmerge_deploy.jar" -xcodegen_path="${TEST_SRCDIR}/src/objc_tools/xcodegen/xcodegen_deploy.jar" -stdredirect_path="${TEST_SRCDIR}/src/tools/xcode/stdredirect/StdRedirect.dylib" -realpath_path="${TEST_SRCDIR}/src/tools/xcode/realpath/realpath" -environment_plist_path="${TEST_SRCDIR}/src/tools/xcode/environment/environment_plist.sh" -xcrunwrapper_path="${TEST_SRCDIR}/src/tools/xcode/xcrunwrapper/xcrunwrapper.sh" +iossim_path="${BAZEL_RUNFILES}/third_party/iossim/iossim" +actoolwrapper_path="${BAZEL_RUNFILES}/src/tools/xcode/actoolwrapper/actoolwrapper.sh" +ibtoolwrapper_path="${BAZEL_RUNFILES}/src/tools/xcode/ibtoolwrapper/ibtoolwrapper.sh" +swiftstdlibtoolwrapper_path="${BAZEL_RUNFILES}/src/tools/xcode/swiftstdlibtoolwrapper/swiftstdlibtoolwrapper.sh" +momcwrapper_path="${BAZEL_RUNFILES}/src/tools/xcode/momcwrapper/momcwrapper.sh" +bundlemerge_path="${BAZEL_RUNFILES}/src/objc_tools/bundlemerge/bundlemerge_deploy.jar" +plmerge_path="${BAZEL_RUNFILES}/src/objc_tools/plmerge/plmerge_deploy.jar" +xcodegen_path="${BAZEL_RUNFILES}/src/objc_tools/xcodegen/xcodegen_deploy.jar" +stdredirect_path="${BAZEL_RUNFILES}/src/tools/xcode/stdredirect/StdRedirect.dylib" +realpath_path="${BAZEL_RUNFILES}/src/tools/xcode/realpath/realpath" +environment_plist_path="${BAZEL_RUNFILES}/src/tools/xcode/environment/environment_plist.sh" +xcrunwrapper_path="${BAZEL_RUNFILES}/src/tools/xcode/xcrunwrapper/xcrunwrapper.sh" # Test data -testdata_path=${TEST_SRCDIR}/src/test/shell/bazel/testdata -python_server="${TEST_SRCDIR}/src/test/shell/bazel/testing_server.py" +testdata_path=${BAZEL_RUNFILES}/src/test/shell/bazel/testdata +python_server="${BAZEL_RUNFILES}/src/test/shell/bazel/testing_server.py" # Third-party PLATFORM="$(uname -s | tr 'A-Z' 'a-z')" @@ -88,22 +89,22 @@ fi case "${PLATFORM}" in darwin) if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then - protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-osx-x86_64.exe" + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-osx-x86_64.exe" else - protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-osx-x86_32.exe" + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-osx-x86_32.exe" fi ;; *) if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then - protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-linux-x86_64.exe" + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_64.exe" else - protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-linux-x86_32.exe" + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_32.exe" fi ;; esac -protoc_jar="${TEST_SRCDIR}/third_party/protobuf/protobuf-*.jar" -junit_jar="${TEST_SRCDIR}/third_party/junit/junit-*.jar" -hamcrest_jar="${TEST_SRCDIR}/third_party/hamcrest/hamcrest-*.jar" +protoc_jar="${BAZEL_RUNFILES}/third_party/protobuf/protobuf-*.jar" +junit_jar="${BAZEL_RUNFILES}/third_party/junit/junit-*.jar" +hamcrest_jar="${BAZEL_RUNFILES}/third_party/hamcrest/hamcrest-*.jar" # This function copies the tools directory from Bazel. function copy_tools_directory() { @@ -151,7 +152,7 @@ function is_tools_directory() { # Copy the examples of the base workspace function copy_examples() { - EXAMPLE="$TEST_SRCDIR/examples" + EXAMPLE="$BAZEL_RUNFILES/examples" cp -RL ${EXAMPLE} . chmod -R +w . } diff --git a/src/test/shell/bazel/workspace_test.sh b/src/test/shell/bazel/workspace_test.sh index 0cd927459b..9c63e381fb 100755 --- a/src/test/shell/bazel/workspace_test.sh +++ b/src/test/shell/bazel/workspace_test.sh @@ -18,7 +18,7 @@ source $(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/test-setup.sh \ || { echo "test-setup.sh not found!" >&2; exit 1; } -export JAVA_RUNFILES=$TEST_SRCDIR +export JAVA_RUNFILES=$BAZEL_RUNFILES function setup_repo() { mkdir -p $1 diff --git a/third_party/ijar/test/BUILD b/third_party/ijar/test/BUILD index f8ebb2a612..507256ce1c 100644 --- a/third_party/ijar/test/BUILD +++ b/third_party/ijar/test/BUILD @@ -13,8 +13,8 @@ sh_test( "$(JAVA)", "$(JAVABASE)/bin/jar", "$(JAVABASE)/bin/javap", - "$(location //third_party/ijar)", - "$(location //tools/jdk:langtools)", + "io_bazel/$(location //third_party/ijar)", + "io_bazel/$(location //tools/jdk:langtools)", # We assume unzip and zip to be on the path "unzip", "zip", diff --git a/third_party/ijar/test/testenv.sh b/third_party/ijar/test/testenv.sh index 66c4811428..235f2c5948 100755 --- a/third_party/ijar/test/testenv.sh +++ b/third_party/ijar/test/testenv.sh @@ -20,7 +20,7 @@ [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } # Load the unit-testing framework -source "${TEST_SRCDIR}/src/test/shell/unittest.bash" || \ +source "${TEST_SRCDIR}/io_bazel/src/test/shell/unittest.bash" || \ { echo "Failed to source unittest.bash" >&2; exit 1; } ## OSX/BSD stat and MD5 |