Luis Fernando Pino Duque | 928a49c | 2016-06-24 09:43:20 +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 | # Integration tests for Bazel client. |
| 17 | # |
| 18 | |
Luis Fernando Pino Duque | fa38906 | 2016-10-18 14:28:42 +0000 | [diff] [blame] | 19 | # Load the test setup defined in the parent directory |
| 20 | CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| 21 | source "${CURRENT_DIR}/../integration_test_setup.sh" \ |
| 22 | || { echo "integration_test_setup.sh not found!" >&2; exit 1; } |
Luis Fernando Pino Duque | 928a49c | 2016-06-24 09:43:20 +0000 | [diff] [blame] | 23 | |
| 24 | function test_product_name_with_bazel_info() { |
kchodorow | 8965981 | 2017-06-21 18:15:36 +0200 | [diff] [blame] | 25 | cat > WORKSPACE <<EOF |
| 26 | workspace(name = 'blerp') |
| 27 | EOF |
| 28 | bazel info >& "$TEST_log" || fail "Expected zero exit" |
Luis Fernando Pino Duque | 928a49c | 2016-06-24 09:43:20 +0000 | [diff] [blame] | 29 | |
kchodorow | 8965981 | 2017-06-21 18:15:36 +0200 | [diff] [blame] | 30 | expect_log "^bazel-bin:.*_bazel.*bazel-out.*bin\$" |
| 31 | expect_log "^bazel-genfiles:.*_bazel.*bazel-out.*genfiles\$" |
| 32 | expect_log "^bazel-testlogs:.*_bazel.*bazel-out.*testlogs\$" |
Googler | db55b5a | 2017-08-10 15:46:16 +0200 | [diff] [blame] | 33 | expect_log "^output_path:.*/execroot/blerp/bazel-out\$" |
kchodorow | 8965981 | 2017-06-21 18:15:36 +0200 | [diff] [blame] | 34 | expect_log "^execution_root:.*/execroot/blerp\$" |
Luis Fernando Pino Duque | 928a49c | 2016-06-24 09:43:20 +0000 | [diff] [blame] | 35 | } |
philwo | a7831cc | 2018-02-01 09:07:39 -0800 | [diff] [blame] | 36 | |
| 37 | # This test is for Bazel only and not for Google's internal version (Blaze), |
| 38 | # because Bazel uses a different way to compute the workspace name. |
| 39 | function test_server_process_name_has_workspace_name() { |
| 40 | mkdir foobarspace |
| 41 | cd foobarspace |
| 42 | touch WORKSPACE BUILD |
| 43 | ps -o cmd= "$(bazel info server_pid)" &>"$TEST_log" |
| 44 | expect_log "^bazel(foobarspace)" |
| 45 | bazel shutdown |
| 46 | } |