aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2015-06-12 08:39:25 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2015-06-12 11:52:44 +0000
commit19f3413dbc4bda45df09ddfbe882c41fc81350d8 (patch)
tree04de4741d18192103104155b6eb8c8b56fa8028a /src/test
parent52b0b2cd3fd84d5e4401f806dea4ca61d7176b9a (diff)
Improve platform and CPU detection, use the correct protoc binary for the running system.
Tested on OS X 10.10, Debian 8.1 (x86_64) and Debian 8.1 (i686). -- MOS_MIGRATED_REVID=95819163
Diffstat (limited to 'src/test')
-rwxr-xr-xsrc/test/shell/bazel/testenv.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/test/shell/bazel/testenv.sh b/src/test/shell/bazel/testenv.sh
index 83dc3394e8..47e53179fe 100755
--- a/src/test/shell/bazel/testenv.sh
+++ b/src/test/shell/bazel/testenv.sh
@@ -41,12 +41,25 @@ ijar_path="${TEST_SRCDIR}/third_party/ijar/ijar"
# Third-party
PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
+MACHINE_TYPE="$(uname -m)"
+MACHINE_IS_64BIT='no'
+if [ "${MACHINE_TYPE}" = 'amd64' -o "${MACHINE_TYPE}" = 'x86_64' ]; then
+ MACHINE_IS_64BIT='yes'
+fi
case "${PLATFORM}" in
darwin)
- protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-osx-x86_32.exe"
+ if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then
+ protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-osx-x86_64.exe"
+ else
+ protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-osx-x86_32.exe"
+ fi
;;
*)
- protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-linux-x86_32.exe"
+ if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then
+ protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-linux-x86_64.exe"
+ else
+ protoc_compiler="${TEST_SRCDIR}/third_party/protobuf/protoc-linux-x86_32.exe"
+ fi
;;
esac
protoc_jar="${TEST_SRCDIR}/third_party/protobuf/protobuf-*.jar"