Damien Martin-Guillerez | 5f9c6ba | 2015-04-09 21:10:33 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Damien Martin-Guillerez | f88f4d8 | 2015-09-25 13:56:55 +0000 | [diff] [blame] | 3 | # Copyright 2015 The Bazel Authors. All rights reserved. |
Damien Martin-Guillerez | 5f9c6ba | 2015-04-09 21:10:33 +0000 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | # Setting up the environment for Bazel completion script test |
| 18 | |
| 19 | [ -z "$TEST_SRCDIR" ] && { echo "TEST_SRCDIR not set!" >&2; exit 1; } |
| 20 | |
| 21 | # Load the unit-testing framework |
Kristina Chodorow | 93fbc3e | 2016-04-27 17:03:28 +0000 | [diff] [blame] | 22 | source "${TEST_SRCDIR}/io_bazel/src/test/shell/unittest.bash" \ |
| 23 | || { echo "Failed to source unittest.bash" >&2; exit 1; } |
Damien Martin-Guillerez | 5f9c6ba | 2015-04-09 21:10:33 +0000 | [diff] [blame] | 24 | |
| 25 | set_up() { |
| 26 | mkdir -p $TEST_TMPDIR/workspace |
| 27 | cd $TEST_TMPDIR/workspace |
| 28 | touch $TEST_TMPDIR/workspace/WORKSPACE |
| 29 | } |
| 30 | |
| 31 | tear_down() { |
| 32 | rm -fr $TEST_TMPDIR/workspace/* |
| 33 | } |