Removing unused functions from test-lib.sh
This commit is contained in:
parent
65eaaa83c2
commit
795b494517
|
@ -12,44 +12,3 @@ SHARNESS_LIB="lib/sharness/sharness.sh"
|
||||||
echo >&2 "Please check Sharness installation."
|
echo >&2 "Please check Sharness installation."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
test_must_be_empty() {
|
|
||||||
if test -s "$1"
|
|
||||||
then
|
|
||||||
echo "'$1' is not empty, it contains:"
|
|
||||||
cat "$1"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
test_should_contain() {
|
|
||||||
test "$#" = 2 || error "bug in the test script: not 2 parameters to test_should_contain"
|
|
||||||
if ! grep -q "$1" "$2"
|
|
||||||
then
|
|
||||||
echo "'$2' does not contain '$1', it contains:"
|
|
||||||
cat "$2"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
test_str_contains() {
|
|
||||||
find=$1
|
|
||||||
shift
|
|
||||||
echo "$@" | egrep "\b$find\b" >/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
test_fsh() {
|
|
||||||
echo "> $@"
|
|
||||||
eval $(shellquote "$@")
|
|
||||||
echo ""
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
test_kill_daemon() {
|
|
||||||
echo "Killing ipfs daemon"
|
|
||||||
ps | grep "ipfs daemon" | grep -v "grep" > daemon_ps.txt
|
|
||||||
sed -i '' 's/^ *//' daemon_ps.txt
|
|
||||||
awk '{print$1}' daemon_ps.txt > daemon_pid.txt &&
|
|
||||||
kill -9 $(< daemon_pid.txt)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user