blob: fecf82c89db8a81f1d3b7d9f5b288e355b7c17e6 [file] [log] [blame]
Irina Iancu39acfc82016-09-15 06:55:38 +00001#!/bin/bash
2# Copyright 2016 The Bazel Authors. All rights reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# Tests that our --host_javabase startup selection algorithm works.
17
Luis Fernando Pino Duquefa389062016-10-18 14:28:42 +000018# Load the test setup defined in the parent directory
19CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20source "${CURRENT_DIR}/../integration_test_setup.sh" \
21 || { echo "integration_test_setup.sh not found!" >&2; exit 1; }
Irina Iancu39acfc82016-09-15 06:55:38 +000022
23function test_use_depot_javabase() {
Luis Fernando Pino Duquefa389062016-10-18 14:28:42 +000024 bazel --batch version >& $TEST_log || fail "Couldn't run ${PRODUCT_NAME}"
Irina Iancu39acfc82016-09-15 06:55:38 +000025 expect_not_log "Couldn't find java at"
26 expect_not_log "Problem with java installation"
27}
28
29function test_fallback_depot_javabase() {
30 bazel --batch --host_javabase=/does/not/exist version >& $TEST_log ||
31 (expect_log "Couldn't find java at" &&
32 expect_not_log "Problem with java installation")
33}
34
Irina Iancu39acfc82016-09-15 06:55:38 +000035run_suite "Tests of specifying custom javabase."