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.
Juan Batiz-Benet committed
Nov 8, 2014 at 18:56 UTC
842de46ccf4aafd193ce8e655b41b04ac5adda66
10 files changed
+21
-17
test/.gitignore
+3
-1
@@ -1,3 +1,5 @@
1
-sharness/
1
+lib/sharness/
2
+bin/ipfs
3
+bin/random
4
test-results/
5
trash directory.*.sh/
test/Makefile
+7
-6
@@ -5,7 +5,7 @@
5
#
6
7
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
8
-SHARNESS = sharness/sharness.sh
8
+SHARNESS = lib/sharness/sharness.sh
9
RANDOMSRC = Godeps/_workspace/src/github.com/jbenet/go-random/random
10
11
all: clean deps $(T) aggregate
@@ -20,23 +20,24 @@ $(T):
20
21
aggregate:
22
@echo "*** $@ ***"
23
- ./test-aggregate-results.sh
23
+ lib/test-aggregate-results.sh
24
25
deps: $(SHARNESS) ipfs random
26
27
$(SHARNESS):
28
@echo "*** installing $@ ***"
29
- ./install-sharness.sh
29
+ lib/install-sharness.sh
30
31
# phony to ensure we re-build it every time we run tests
32
ipfs:
33
@echo "*** installing $@ ***"
34
+ mkdir -p bin
35
cd ../cmd/ipfs && go build
35
- cp ../cmd/ipfs/ipfs ipfs
36
+ cp ../cmd/ipfs/ipfs bin/ipfs
37
38
random:
39
@echo "*** installing $@ ***"
39
- go build ../$(RANDOMSRC)
40
- cp ../$(RANDOMSRC)/random random
40
+ mkdir -p bin
41
+ go build -o bin/random ../$(RANDOMSRC)
42
43
.PHONY: all clean $(T) aggregate ipfs random
test/lib/install-sharness.sh
renamed
+3
-2
@@ -8,6 +8,7 @@
8
# settings
9
version=50229a79ba22b2f13ccd82451d86570fecbd194c
10
urlprefix=https://raw.githubusercontent.com/mlafeldt/sharness/$version
11
+installpath=lib/sharness
12
13
# files to download
14
sfile=sharness.sh
@@ -39,8 +40,8 @@ verified_download() {
40
return 0
41
}
42
42
-mkdir -p sharness || die "Could not create 'sharness' directory"
43
-cd sharness || die "Could not cd into 'sharness' directory"
43
+mkdir -p $installpath || die "Could not create 'sharness' directory"
44
+cd $installpath || die "Could not cd into 'sharness' directory"
45
46
verified_download "$sfile" "$shash"; sok=$?
47
verified_download "$afile" "$ahash"; aok=$?
test/lib/random-dep.go
renamed
test/lib/test-aggregate-results.sh
renamed
+1
-1
@@ -6,7 +6,7 @@
6
# MIT Licensed; see the LICENSE file in this repository.
7
#
8
9
-SHARNESS_AGGREGATE="sharness/aggregate-results.sh"
9
+SHARNESS_AGGREGATE="lib/sharness/aggregate-results.sh"
10
11
test -f "$SHARNESS_AGGREGATE" || {
12
echo >&2 "Cannot find: $SHARNESS_AGGREGATE"
test/lib/test-lib.sh
renamed
+3
-3
@@ -9,16 +9,16 @@
9
# use the ipfs tool to test against
10
11
# add current directory to path, for ipfs tool.
12
-PATH=$(pwd):${PATH}
12
+PATH=$(pwd)/bin:${PATH}
13
14
# assert the `ipfs` we're using is the right one.
15
-if test `which ipfs` != $(pwd)/ipfs; then
15
+if test `which ipfs` != $(pwd)/bin/ipfs; then
16
echo >&2 "Cannot find the tests' local ipfs tool."
17
echo >&2 "Please check test and ipfs tool installation."
18
exit 1
19
fi
20
21
-SHARNESS_LIB="sharness/sharness.sh"
21
+SHARNESS_LIB="lib/sharness/sharness.sh"
22
23
. "$SHARNESS_LIB" || {
24
echo >&2 "Cannot source: $SHARNESS_LIB"
test/t0010-basic-commands.sh
+1
-1
@@ -6,7 +6,7 @@
6
7
test_description="Test installation and some basic commands"
8
9
-. ./test-lib.sh
9
+. lib/test-lib.sh
10
11
test_expect_success "current dir is writable" '
12
echo "It works!" >test.txt
test/t0020-init.sh
+1
-1
@@ -6,7 +6,7 @@
6
7
test_description="Test init command"
8
9
-. ./test-lib.sh
9
+. lib/test-lib.sh
10
11
test_expect_success "ipfs init succeeds" '
12
export IPFS_DIR="$(pwd)/.go-ipfs" &&
test/t0030-mount.sh
+1
-1
@@ -6,7 +6,7 @@
6
7
test_description="Test mount command"
8
9
-. ./test-lib.sh
9
+. lib/test-lib.sh
10
11
# if in travis CI, dont test mount (no fuse)
12
if ! test_have_prereq FUSE; then
test/t0040-add-and-cat.sh
+1
-1
@@ -6,7 +6,7 @@
6
7
test_description="Test add and cat commands"
8
9
-. ./test-lib.sh
9
+. lib/test-lib.sh
10
11
test_launch_ipfs_mount
12