blob: dd67dc487ccb6a5c0bc5a379d660aaf4f34eed93 [file] [log] [blame]
Luis Fernando Pino Duque928a49c2016-06-24 09:43:20 +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# Integration tests for Bazel client.
17#
18
Luis Fernando Pino Duquefa389062016-10-18 14:28:42 +000019# Load the test setup defined in the parent directory
20CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21source "${CURRENT_DIR}/../integration_test_setup.sh" \
22 || { echo "integration_test_setup.sh not found!" >&2; exit 1; }
Luis Fernando Pino Duque928a49c2016-06-24 09:43:20 +000023
24function test_product_name_with_bazel_info() {
kchodorow89659812017-06-21 18:15:36 +020025 cat > WORKSPACE <<EOF
26workspace(name = 'blerp')
27EOF
28 bazel info >& "$TEST_log" || fail "Expected zero exit"
Luis Fernando Pino Duque928a49c2016-06-24 09:43:20 +000029
kchodorow89659812017-06-21 18:15:36 +020030 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\$"
Googlerdb55b5a2017-08-10 15:46:16 +020033 expect_log "^output_path:.*/execroot/blerp/bazel-out\$"
kchodorow89659812017-06-21 18:15:36 +020034 expect_log "^execution_root:.*/execroot/blerp\$"
Luis Fernando Pino Duque928a49c2016-06-24 09:43:20 +000035}
philwoa7831cc2018-02-01 09:07:39 -080036
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.
39function 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}