mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
The new ipfs-test-lib.sh file contains generic test functions. We also start replacing fsh with a shell function named test_fsh() in ipfs-test-lib.sh. And we move our custom test_cmp in ipfs-test-lib.sh. License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
19 lines
410 B
Bash
19 lines
410 B
Bash
# Generic test functions for go-ipfs
|
|
|
|
# Echo the args, run the cmd, and then also fail,
|
|
# making sure a test case fails.
|
|
test_fsh() {
|
|
echo "> $@"
|
|
eval "$@"
|
|
echo ""
|
|
false
|
|
}
|
|
|
|
# Same as sharness' test_cmp but using test_fsh (to see the output).
|
|
# We have to do it twice, so the first diff output doesn't show unless it's
|
|
# broken.
|
|
test_cmp() {
|
|
diff -q "$@" >/dev/null || test_fsh diff -u "$@"
|
|
}
|
|
|