diff options
author | 2018-02-02 01:14:20 -0800 | |
---|---|---|
committer | 2018-02-02 01:15:52 -0800 | |
commit | 46cd4fd2e120fe3c5f08f44422bc5d3ddaecde42 (patch) | |
tree | 5a80152202da5ce82d12f01c6244c4af029c67ae /src/test/shell | |
parent | b534e6be304f06a40c10ba7834625c5222bb9154 (diff) |
windows,tests,testenv.sh: remove hardcoded envvars
Remove most of the hardcoded, Windows-only envvars
from testenv.sh:
- BAZEL_VC and BAZEL_PYTHON: Bazel can autodetect
these
- TMP/TEMP/TMPDIR and TEST_TMPDIR: Bazel sets
these automatically
As for BAZEL_SH, we can just get bash's path using
cygpath. We know there is a bash since this is
already inside a bash script.
Also, use `rlocation` for some of the the runfile
lookups.
Change-Id: Ib35d285ec0cbb88cb5d603a4eb0f3386f3c2033b
PiperOrigin-RevId: 184253597
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/bazel/bazel_bootstrap_distfile_test.sh | 2 | ||||
-rwxr-xr-x | src/test/shell/testenv.sh | 25 |
2 files changed, 2 insertions, 25 deletions
diff --git a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh index 9b0375a754..783ed88a7d 100755 --- a/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh +++ b/src/test/shell/bazel/bazel_bootstrap_distfile_test.sh @@ -31,7 +31,7 @@ source $(rlocation io_bazel/src/test/shell/integration_test_setup.sh) \ || { echo "integration_test_setup.sh not found!" >&2; exit 1; } function _log_progress() { - if [[ "$PLATFORM" =~ msys ]]; then + if is_windows; then log_info "test_bootstrap: $*" fi } diff --git a/src/test/shell/testenv.sh b/src/test/shell/testenv.sh index 5293f3f7ba..8e82ba706f 100755 --- a/src/test/shell/testenv.sh +++ b/src/test/shell/testenv.sh @@ -54,32 +54,9 @@ if is_windows; then # TODO(philwo) remove this once we have a Bazel release that includes the CL # moving the Windows-specific TEST_TMPDIR into TestStrategy. TEST_TMPDIR_BASENAME="$(basename "$TEST_TMPDIR")" - export TEST_TMPDIR="c:/temp/${TEST_TMPDIR_BASENAME}" - - # Bazel (TMPDIR) and Windows (TEMP, TMP) have three envvars that specify the - # location of the temp directory... - export TMPDIR="$TEST_TMPDIR" - export TEMP="$TEST_TMPDIR" - export TMP="$TEST_TMPDIR" export JAVA_HOME="$(ls -d C:/Program\ Files/Java/jdk* | sort | tail -n 1)" - export BAZEL_SH="c:/tools/msys64/usr/bin/bash.exe" - export BAZEL_VC="c:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC" - if [ ! -d "$BAZEL_VC" ]; then - # Maybe Visual C++ Build Tools 2017 then? - export BAZEL_VC="c:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC" - fi - if [ ! -d "$BAZEL_VC" ]; then - # OK, well, maybe Visual C++ 2015 then? - export BAZEL_VC="c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC" - fi - if [ -x /c/Python27/python.exe ]; then - export BAZEL_PYTHON="C:/Python27/python.exe" - export PATH="/c/Python27:$PATH" - elif [ -x /c/python_27_amd64/files/python.exe ]; then - export BAZEL_PYTHON="C:/python_27_amd64/files/python.exe" - export PATH="/c/python_27_amd64/files:$PATH" - fi + export BAZEL_SH="$(cygpath -m /usr/bin/bash)" fi # Make the command "bazel" available for tests. |