summaryrefslogtreecommitdiff
path: root/tests/tap/libtap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tap/libtap.sh')
-rw-r--r--tests/tap/libtap.sh28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/tap/libtap.sh b/tests/tap/libtap.sh
index 9731032..38181d9 100644
--- a/tests/tap/libtap.sh
+++ b/tests/tap/libtap.sh
@@ -7,10 +7,10 @@
#
# This file provides a TAP-compatible shell function library useful for
# writing test cases. It is part of C TAP Harness, which can be found at
-# <http://www.eyrie.org/~eagle/software/c-tap-harness/>.
+# <https://www.eyrie.org/~eagle/software/c-tap-harness/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2009, 2010, 2011, 2012 Russ Allbery <eagle@eyrie.org>
+# Copyright 2009, 2010, 2011, 2012, 2016 Russ Allbery <eagle@eyrie.org>
# Copyright 2006, 2007, 2008, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -31,6 +31,8 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
+#
+# SPDX-License-Identifier: MIT
# Print out the number of test cases we expect to run.
plan () {
@@ -212,32 +214,32 @@ diag () {
echo '#' "$@"
}
-# Search for the given file first in $BUILD and then in $SOURCE and echo the
-# path where the file was found, or the empty string if the file wasn't
-# found.
+# Search for the given file first in $C_TAP_BUILD and then in $C_TAP_SOURCE
+# and echo the path where the file was found, or the empty string if the file
+# wasn't found.
#
# This macro uses puts, so don't run it using backticks inside double quotes
# or bizarre quoting behavior will happen with Solaris sh.
test_file_path () {
- if [ -n "$BUILD" ] && [ -f "$BUILD/$1" ] ; then
- puts "$BUILD/$1"
- elif [ -n "$SOURCE" ] && [ -f "$SOURCE/$1" ] ; then
- puts "$SOURCE/$1"
+ if [ -n "$C_TAP_BUILD" ] && [ -f "$C_TAP_BUILD/$1" ] ; then
+ puts "$C_TAP_BUILD/$1"
+ elif [ -n "$C_TAP_SOURCE" ] && [ -f "$C_TAP_SOURCE/$1" ] ; then
+ puts "$C_TAP_SOURCE/$1"
else
echo ''
fi
}
-# Create $BUILD/tmp for use by tests for storing temporary files and return
-# the path (via standard output).
+# Create $C_TAP_BUILD/tmp for use by tests for storing temporary files and
+# return the path (via standard output).
#
# This macro uses puts, so don't run it using backticks inside double quotes
# or bizarre quoting behavior will happen with Solaris sh.
test_tmpdir () {
- if [ -z "$BUILD" ] ; then
+ if [ -z "$C_TAP_BUILD" ] ; then
tap_tmpdir="./tmp"
else
- tap_tmpdir="$BUILD"/tmp
+ tap_tmpdir="$C_TAP_BUILD"/tmp
fi
if [ ! -d "$tap_tmpdir" ] ; then
mkdir "$tap_tmpdir" || bail "Error creating $tap_tmpdir"