Irina Iancu | 39acfc8 | 2016-09-15 06:55:38 +0000 | [diff] [blame] | 1 | #!/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 Duque | fa38906 | 2016-10-18 14:28:42 +0000 | [diff] [blame] | 18 | # Load the test setup defined in the parent directory |
| 19 | CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 20 | source "${CURRENT_DIR}/../integration_test_setup.sh" \ |
| 21 | || { echo "integration_test_setup.sh not found!" >&2; exit 1; } |
Irina Iancu | 39acfc8 | 2016-09-15 06:55:38 +0000 | [diff] [blame] | 22 | |
| 23 | function test_use_depot_javabase() { |
Luis Fernando Pino Duque | fa38906 | 2016-10-18 14:28:42 +0000 | [diff] [blame] | 24 | bazel --batch version >& $TEST_log || fail "Couldn't run ${PRODUCT_NAME}" |
Irina Iancu | 39acfc8 | 2016-09-15 06:55:38 +0000 | [diff] [blame] | 25 | expect_not_log "Couldn't find java at" |
| 26 | expect_not_log "Problem with java installation" |
| 27 | } |
| 28 | |
| 29 | function 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 Iancu | 39acfc8 | 2016-09-15 06:55:38 +0000 | [diff] [blame] | 35 | run_suite "Tests of specifying custom javabase." |