| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Bash TAP Bootstrap: |
| 4 |
# Copy this file into your project tests dir and source it |
| 5 |
# from each test file with: |
| 6 |
# . $(dirname $0)/bash-tap-bootstrap |
| 7 |
# It takes care of finding bash-tap or outputing a usage message. |
| 8 |
# |
| 9 |
|
| 10 |
bash_tap_bootstrap_version='1.0.2' |
| 11 |
|
| 12 |
if [ "${BASH_SOURCE[0]}" = "$0" ]; then |
| 13 |
# Being run directly, probably by test harness running entire dir. |
| 14 |
echo "1..0 # SKIP bash-tap-bootstrap isn't a test file" |
| 15 |
exit 0 |
| 16 |
fi |
| 17 |
|
| 18 |
if [ -z "$BASH_TAP_ROOT" ]; then |
| 19 |
# TODO: search likely locations. |
| 20 |
BASH_TAP_ROOT="$(dirname ${BASH_SOURCE[0]})/../../bash-tap" |
| 21 |
fi |
| 22 |
|
| 23 |
if [ -f "$BASH_TAP_ROOT/bash-tap" ]; then |
| 24 |
. "$BASH_TAP_ROOT/bash-tap" |
| 25 |
else |
| 26 |
echo "Bail out! Unable to find bash-tap. Install from https://github.com/illusori/bash-tap or set \$BASH_TAP_ROOT if you have it installed somewhere unusual." |
| 27 |
exit 255 |
| 28 |
fi |