mirror of
https://github.com/ipfs/kubo.git
synced 2025-10-25 02:16:56 +08:00
test: moved installed things into own dirs
I moved installed things into own dirs bin and lib. @chriscool sorry to move things around again, the top level test dir was getting a bit clutterd.
This commit is contained in:
4
test/.gitignore
vendored
4
test/.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
sharness/
|
||||
lib/sharness/
|
||||
bin/ipfs
|
||||
bin/random
|
||||
test-results/
|
||||
trash directory.*.sh/
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#
|
||||
|
||||
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
|
||||
SHARNESS = sharness/sharness.sh
|
||||
SHARNESS = lib/sharness/sharness.sh
|
||||
RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
|
||||
|
||||
all: clean deps $(T) aggregate
|
||||
@ -20,23 +20,24 @@ $(T):
|
||||
|
||||
aggregate:
|
||||
@echo "*** $@ ***"
|
||||
./test-aggregate-results.sh
|
||||
lib/test-aggregate-results.sh
|
||||
|
||||
deps: $(SHARNESS) ipfs random
|
||||
|
||||
$(SHARNESS):
|
||||
@echo "*** installing $@ ***"
|
||||
./install-sharness.sh
|
||||
lib/install-sharness.sh
|
||||
|
||||
# phony to ensure we re-build it every time we run tests
|
||||
ipfs:
|
||||
@echo "*** installing $@ ***"
|
||||
mkdir -p bin
|
||||
cd ../cmd/ipfs && go build
|
||||
cp ../cmd/ipfs/ipfs ipfs
|
||||
cp ../cmd/ipfs/ipfs bin/ipfs
|
||||
|
||||
random:
|
||||
@echo "*** installing $@ ***"
|
||||
go build ../$(RANDOMSRC)
|
||||
cp ../$(RANDOMSRC)/random random
|
||||
mkdir -p bin
|
||||
go build -o bin/random ../$(RANDOMSRC)
|
||||
|
||||
.PHONY: all clean $(T) aggregate ipfs random
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
# settings
|
||||
version=50229a79ba22b2f13ccd82451d86570fecbd194c
|
||||
urlprefix=https://raw.githubusercontent.com/mlafeldt/sharness/$version
|
||||
installpath=lib/sharness
|
||||
|
||||
# files to download
|
||||
sfile=sharness.sh
|
||||
@ -39,8 +40,8 @@ verified_download() {
|
||||
return 0
|
||||
}
|
||||
|
||||
mkdir -p sharness || die "Could not create 'sharness' directory"
|
||||
cd sharness || die "Could not cd into 'sharness' directory"
|
||||
mkdir -p $installpath || die "Could not create 'sharness' directory"
|
||||
cd $installpath || die "Could not cd into 'sharness' directory"
|
||||
|
||||
verified_download "$sfile" "$shash"; sok=$?
|
||||
verified_download "$afile" "$ahash"; aok=$?
|
||||
@ -6,7 +6,7 @@
|
||||
# MIT Licensed; see the LICENSE file in this repository.
|
||||
#
|
||||
|
||||
SHARNESS_AGGREGATE="sharness/aggregate-results.sh"
|
||||
SHARNESS_AGGREGATE="lib/sharness/aggregate-results.sh"
|
||||
|
||||
test -f "$SHARNESS_AGGREGATE" || {
|
||||
echo >&2 "Cannot find: $SHARNESS_AGGREGATE"
|
||||
@ -9,16 +9,16 @@
|
||||
# use the ipfs tool to test against
|
||||
|
||||
# add current directory to path, for ipfs tool.
|
||||
PATH=$(pwd):${PATH}
|
||||
PATH=$(pwd)/bin:${PATH}
|
||||
|
||||
# assert the `ipfs` we're using is the right one.
|
||||
if test `which ipfs` != $(pwd)/ipfs; then
|
||||
if test `which ipfs` != $(pwd)/bin/ipfs; then
|
||||
echo >&2 "Cannot find the tests' local ipfs tool."
|
||||
echo >&2 "Please check test and ipfs tool installation."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SHARNESS_LIB="sharness/sharness.sh"
|
||||
SHARNESS_LIB="lib/sharness/sharness.sh"
|
||||
|
||||
. "$SHARNESS_LIB" || {
|
||||
echo >&2 "Cannot source: $SHARNESS_LIB"
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
test_description="Test installation and some basic commands"
|
||||
|
||||
. ./test-lib.sh
|
||||
. lib/test-lib.sh
|
||||
|
||||
test_expect_success "current dir is writable" '
|
||||
echo "It works!" >test.txt
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
test_description="Test init command"
|
||||
|
||||
. ./test-lib.sh
|
||||
. lib/test-lib.sh
|
||||
|
||||
test_expect_success "ipfs init succeeds" '
|
||||
export IPFS_DIR="$(pwd)/.go-ipfs" &&
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
test_description="Test mount command"
|
||||
|
||||
. ./test-lib.sh
|
||||
. lib/test-lib.sh
|
||||
|
||||
# if in travis CI, dont test mount (no fuse)
|
||||
if ! test_have_prereq FUSE; then
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
test_description="Test add and cat commands"
|
||||
|
||||
. ./test-lib.sh
|
||||
. lib/test-lib.sh
|
||||
|
||||
test_launch_ipfs_mount
|
||||
|
||||
|
||||
Reference in New Issue
Block a user