mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-07 01:08:08 +08:00
Add test-lib.sh for our shell test framework
Our test framework is based on Sharness. So the first thing to do is to source it.
This commit is contained in:
parent
bd5a1c0c0f
commit
449523eebd
34
test/test-lib.sh
Normal file
34
test/test-lib.sh
Normal file
@ -0,0 +1,34 @@
|
||||
# Test framework for go-ipfs
|
||||
#
|
||||
# Copyright (c) 2014 Christian Couder
|
||||
# MIT Licensed; see the LICENSE file in this repository.
|
||||
#
|
||||
# We are using sharness (https://github.com/mlafeldt/sharness)
|
||||
# which was extracted from the Git test framework.
|
||||
|
||||
# You need either sharness to be installed system-wide
|
||||
# or to set SHARNESS_DIRECTORY properly
|
||||
|
||||
if test -z "$SHARNESS_DIRECTORY"
|
||||
then
|
||||
SHARNESS_DIRECTORY=/usr/local/share/sharness
|
||||
fi
|
||||
|
||||
SHARNESS_LIB="$SHARNESS_DIRECTORY/sharness.sh"
|
||||
|
||||
test -f "$SHARNESS_LIB" || {
|
||||
echo >&2 "Cannot find sharness.sh in: $SHARNESS_DIRECTORY"
|
||||
echo >&2 "Please install Sharness system-wide or set the"
|
||||
echo >&2 "SHARNESS_DIRECTORY environment variable."
|
||||
echo >&2 "See: https://github.com/mlafeldt/sharness"
|
||||
exit 1
|
||||
}
|
||||
|
||||
. "$SHARNESS_LIB" || {
|
||||
echo >&2 "Cannot source: $SHARNESS_LIB"
|
||||
echo >&2 "Please check Sharness installation."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Please put go-ipfs specific shell functions below
|
||||
|
||||
Loading…
Reference in New Issue
Block a user