Skip to content

Commit

Permalink
Merge pull request #211 from chriscool/improve_tests
Browse files Browse the repository at this point in the history
Improve tests
  • Loading branch information
jbenet committed Oct 26, 2014
2 parents 54c2a14 + 8357c7b commit b4ea414
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-results/
5 changes: 4 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
all: clean $(T) aggregate

clean:
@echo "*** $@ ***"
-rm -r test-results

$(T):
@echo "*** $@ ***"; ./$@
@echo "*** $@ ***"
./$@

aggregate:
@echo "*** $@ ***"
./test-aggregate-results.sh

.PHONY: all clean $(T) aggregate
29 changes: 29 additions & 0 deletions test/t0020-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#

test_description="Test init command"

. ./test-lib.sh

test_expect_success "ipfs init succeeds" '
export IPFS_DIR="$(pwd)/.go-ipfs" &&
ipfs init
'

test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" &&
test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore"
'

test_expect_success "ipfs config succeeds" '
echo leveldb >expected &&
ipfs config Datastore.Type >actual &&
test_cmp expected actual
'

test_done

0 comments on commit b4ea414

Please sign in to comment.