Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 1a56722

Browse files
committed
test-lib: properly check the 'ipfs' tool we use
1 parent c264f74 commit 1a56722

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

test/sharness/lib/test-lib.sh

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,28 @@
33
# Copyright (c) 2014 Christian Couder
44
# MIT Licensed; see the LICENSE file in this repository.
55
#
6-
# We are using sharness (https://github.com/mlafeldt/sharness)
6+
# We are using sharness (https://github.com/chriscool/sharness)
77
# which was extracted from the Git test framework.
88

9-
# use the ipfs tool to test against
10-
119
# add current directory to path, for ipfs tool.
1210
BIN=$(cd .. && echo `pwd`/bin)
1311
PATH=${BIN}:${PATH}
1412

13+
# assert the `ipfs` we're using is the right one.
14+
if test $(which ipfs) != ${BIN}/ipfs; then
15+
echo >&2 "Cannot find the tests' local ipfs tool."
16+
echo >&2 "Please check test and ipfs tool installation."
17+
JS_BIN=$(dirname $(dirname "${BIN}"))"/src/cli/bin.js"
18+
echo >&2 "For js-ipfs, look for a symlink from '${BIN}/ipfs' to '${JS_BIN}'."
19+
echo >&2 "Use 'make' or 'make deps' as it should install this symlink."
20+
exit 1
21+
fi
22+
1523
# set sharness verbosity. we set the env var directly as
1624
# it's too late to pass in --verbose, and --verbose is harder
1725
# to pass through in some cases.
1826
test "$TEST_VERBOSE" = 1 && verbose=t
1927

20-
# TODO: fix this for js-ipfs
21-
# assert the `ipfs` we're using is the right one.
22-
##if test `which ipfs` != ${BIN}/ipfs; then
23-
## echo >&2 "Cannot find the tests' local ipfs tool."
24-
## echo >&2 "Please check test and ipfs tool installation."
25-
## exit 1
26-
##fi
27-
28-
2928
# source the common hashes first.
3029
. lib/test-lib-hashes.sh
3130

0 commit comments

Comments
 (0)