aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2016-10-21 13:20:59 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-10-21 14:21:40 +0000
commit3eef69dbef66371d0d3633a8e5fbbfe9971df961 (patch)
treee36cf7b23d2bf362978b0661eaf87c65a1919862
parentc17ee05daa4b7e9a9a6e63e90d610d37a934b0c6 (diff)
Fix and re-enable bazel_windows_example_test
-- Change-Id: I09d8ef5daceb48066ec40420ad5cf21514059f4a Reviewed-on: https://bazel-review.googlesource.com/#/c/6770 MOS_MIGRATED_REVID=136825145
-rwxr-xr-xscripts/ci/windows/compile_windows.sh1
-rwxr-xr-xsrc/test/shell/bazel/bazel_windows_example_test.sh5
-rwxr-xr-xsrc/test/shell/testenv.sh30
3 files changed, 21 insertions, 15 deletions
diff --git a/scripts/ci/windows/compile_windows.sh b/scripts/ci/windows/compile_windows.sh
index 6f36de179b..03d4087f0c 100755
--- a/scripts/ci/windows/compile_windows.sh
+++ b/scripts/ci/windows/compile_windows.sh
@@ -59,6 +59,7 @@ cp output/bazel.exe output/ci/bazel-$(get_full_release_name).exe
# todo(bazel-team): add more tests here.
echo "Running tests"
./output/bazel test -k --test_output=all --test_tag_filters -no_windows\
+ //src/test/shell/bazel:bazel_windows_example_test \
//src/test/java/...
retCode=$?
diff --git a/src/test/shell/bazel/bazel_windows_example_test.sh b/src/test/shell/bazel/bazel_windows_example_test.sh
index d5d22d010c..910d98f742 100755
--- a/src/test/shell/bazel/bazel_windows_example_test.sh
+++ b/src/test/shell/bazel/bazel_windows_example_test.sh
@@ -23,8 +23,7 @@ if ! type rlocation &> /dev/null; then
fi
# Load the test setup defined in the parent directory
-CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-source "${CURRENT_DIR}/../integration_test_setup.sh" \
+source $(rlocation io_bazel/src/test/shell/integration_test_setup.sh) \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }
if ! is_windows; then
@@ -34,7 +33,7 @@ fi
function set_up() {
copy_examples
- export PATH=$PATH:/c/python_27_amd64/files
+ export PATH=/c/python_27_amd64/files:$PATH
EXTRA_BAZELRC="build --cpu=x64_windows_msvc"
setup_bazelrc
}
diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh
index d465c9f136..ec0fa47aa5 100755
--- a/src/test/shell/testenv.sh
+++ b/src/test/shell/testenv.sh
@@ -19,9 +19,26 @@
# TODO(bazel-team): This file is currently an append of the old testenv.sh and
# test-setup.sh files. This must be cleaned up eventually.
+# Windows
+PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
+function is_windows() {
+ # On windows, the shell test is actually running on msys
+ if [[ "${PLATFORM}" =~ msys_nt* ]]; then
+ true
+ else
+ false
+ fi
+}
+
# Make the command "bazel" available for tests.
PATH_TO_BAZEL_BIN=$(rlocation io_bazel/src/bazel)
-PATH_TO_BAZEL_WRAPPER="${TEST_SRCDIR}/io_bazel/src/test/shell/bin"
+PATH_TO_BAZEL_WRAPPER="$(dirname $(rlocation io_bazel/src/test/shell/bin/bazel))"
+# Convert PATH_TO_BAZEL_WRAPPER to Unix path style on Windows, because it will be
+# added into PATH. There's problem if PATH=C:/msys64/usr/bin:/usr/local,
+# because ':' is used as both path seperator and in C:/msys64/...
+if is_windows; then
+ PATH_TO_BAZEL_WRAPPER="$(cygpath -u "$PATH_TO_BAZEL_WRAPPER")"
+fi
if [ ! -f "${PATH_TO_BAZEL_WRAPPER}/bazel" ];
then
echo "Unable to find the Bazel binary at $PATH_TO_BAZEL_WRAPPER/bazel" >&2
@@ -53,17 +70,6 @@ workspace_file="${BAZEL_RUNFILES}/WORKSPACE"
bazel_tree="$(rlocation io_bazel/src/test/shell/bazel/doc-srcs.zip)"
bazel_data="${BAZEL_RUNFILES}"
-# Windows
-PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
-function is_windows() {
- # On windows, the shell test actually running on msys
- if [[ "${PLATFORM}" =~ msys_nt* ]]; then
- true
- else
- false
- fi
-}
-
# Java
if is_windows; then
jdk_dir="$(cygpath -m $(cd $(rlocation local_jdk/bin/java.exe)/../..; pwd))"