提交 842de46c 作者: Juan Batiz-Benet

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.
上级 5680c112
sharness/ lib/sharness/
bin/ipfs
bin/random
test-results/ test-results/
trash directory.*.sh/ trash directory.*.sh/
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# #
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) 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 RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
all: clean deps $(T) aggregate all: clean deps $(T) aggregate
...@@ -20,23 +20,24 @@ $(T): ...@@ -20,23 +20,24 @@ $(T):
aggregate: aggregate:
@echo "*** $@ ***" @echo "*** $@ ***"
./test-aggregate-results.sh lib/test-aggregate-results.sh
deps: $(SHARNESS) ipfs random deps: $(SHARNESS) ipfs random
$(SHARNESS): $(SHARNESS):
@echo "*** installing $@ ***" @echo "*** installing $@ ***"
./install-sharness.sh lib/install-sharness.sh
# phony to ensure we re-build it every time we run tests # phony to ensure we re-build it every time we run tests
ipfs: ipfs:
@echo "*** installing $@ ***" @echo "*** installing $@ ***"
mkdir -p bin
cd ../cmd/ipfs && go build cd ../cmd/ipfs && go build
cp ../cmd/ipfs/ipfs ipfs cp ../cmd/ipfs/ipfs bin/ipfs
random: random:
@echo "*** installing $@ ***" @echo "*** installing $@ ***"
go build ../$(RANDOMSRC) mkdir -p bin
cp ../$(RANDOMSRC)/random random go build -o bin/random ../$(RANDOMSRC)
.PHONY: all clean $(T) aggregate ipfs random .PHONY: all clean $(T) aggregate ipfs random
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# settings # settings
version=50229a79ba22b2f13ccd82451d86570fecbd194c version=50229a79ba22b2f13ccd82451d86570fecbd194c
urlprefix=https://raw.githubusercontent.com/mlafeldt/sharness/$version urlprefix=https://raw.githubusercontent.com/mlafeldt/sharness/$version
installpath=lib/sharness
# files to download # files to download
sfile=sharness.sh sfile=sharness.sh
...@@ -39,8 +40,8 @@ verified_download() { ...@@ -39,8 +40,8 @@ verified_download() {
return 0 return 0
} }
mkdir -p sharness || die "Could not create 'sharness' directory" mkdir -p $installpath || die "Could not create 'sharness' directory"
cd sharness || die "Could not cd into 'sharness' directory" cd $installpath || die "Could not cd into 'sharness' directory"
verified_download "$sfile" "$shash"; sok=$? verified_download "$sfile" "$shash"; sok=$?
verified_download "$afile" "$ahash"; aok=$? verified_download "$afile" "$ahash"; aok=$?
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
# MIT Licensed; see the LICENSE file in this repository. # 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" || { test -f "$SHARNESS_AGGREGATE" || {
echo >&2 "Cannot find: $SHARNESS_AGGREGATE" echo >&2 "Cannot find: $SHARNESS_AGGREGATE"
......
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
# use the ipfs tool to test against # use the ipfs tool to test against
# add current directory to path, for ipfs tool. # 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. # 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 "Cannot find the tests' local ipfs tool."
echo >&2 "Please check test and ipfs tool installation." echo >&2 "Please check test and ipfs tool installation."
exit 1 exit 1
fi fi
SHARNESS_LIB="sharness/sharness.sh" SHARNESS_LIB="lib/sharness/sharness.sh"
. "$SHARNESS_LIB" || { . "$SHARNESS_LIB" || {
echo >&2 "Cannot source: $SHARNESS_LIB" echo >&2 "Cannot source: $SHARNESS_LIB"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
test_description="Test installation and some basic commands" test_description="Test installation and some basic commands"
. ./test-lib.sh . lib/test-lib.sh
test_expect_success "current dir is writable" ' test_expect_success "current dir is writable" '
echo "It works!" >test.txt echo "It works!" >test.txt
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
test_description="Test init command" test_description="Test init command"
. ./test-lib.sh . lib/test-lib.sh
test_expect_success "ipfs init succeeds" ' test_expect_success "ipfs init succeeds" '
export IPFS_DIR="$(pwd)/.go-ipfs" && export IPFS_DIR="$(pwd)/.go-ipfs" &&
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
test_description="Test mount command" test_description="Test mount command"
. ./test-lib.sh . lib/test-lib.sh
# if in travis CI, dont test mount (no fuse) # if in travis CI, dont test mount (no fuse)
if ! test_have_prereq FUSE; then if ! test_have_prereq FUSE; then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
test_description="Test add and cat commands" test_description="Test add and cat commands"
. ./test-lib.sh . lib/test-lib.sh
test_launch_ipfs_mount test_launch_ipfs_mount
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论