Move counter cli tests into example dir

This commit is contained in:
Ethan Frey 2017-08-30 20:31:17 +02:00
parent 21cc189043
commit ce46642aa0
3 changed files with 26 additions and 5 deletions

View File

@ -4,6 +4,7 @@ GOTOOLS = github.com/mitchellh/gox \
TUTORIALS=$(shell find docs/guide -name "*md" -type f)
EXAMPLES := counter
EXAMPLE_DIRS := $(addprefix ./examples/,${EXAMPLES})
LINKER_FLAGS:="-X github.com/cosmos/cosmos-sdk/client/commands.CommitHash=`git rev-parse --short HEAD`"
@ -14,8 +15,8 @@ build:
install:
@go install -ldflags $(LINKER_FLAGS) ./cmd/...
@for EX in $(EXAMPLES); do \
go install -ldflags $(LINKER_FLAGS) ./examples/$$EX/cmd/...; \
@for EX in $(EXAMPLE_DIRS); do \
cd $$EX && make install; \
done
dist:
@ -40,10 +41,12 @@ test_cli: tests/cli/shunit2
./tests/cli/basictx.sh
./tests/cli/eyes.sh
./tests/cli/roles.sh
./tests/cli/counter.sh
./tests/cli/restart.sh
./tests/cli/rest.sh
./tests/cli/ibc.sh
@for EX in $(EXAMPLE_DIRS); do \
cd $$EX && make test_cli; \
done
test_tutorial: docs/guide/shunit2
@shelldown ${TUTORIALS}

14
examples/counter/Makefile Normal file
View File

@ -0,0 +1,14 @@
LINKER_FLAGS:="-X github.com/cosmos/cosmos-sdk/client/commands.CommitHash=`git rev-parse --short HEAD`"
install:
@go install -ldflags $(LINKER_FLAGS) ./cmd/...
test: test_unit test_cli
test_unit:
@go test `glide novendor`
test_cli:
./tests/cli/counter.sh
.PHONY: install test test_unit test_cli

View File

@ -112,5 +112,9 @@ test03AddCount() {
# Load common then run these tests with shunit2!
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #get this files directory
. $DIR/common.sh
. $DIR/shunit2
# TODO: how to handle this if we are not in the same directory
CLI_DIR=${DIR}/../../../../tests/cli
. $CLI_DIR/common.sh
. $CLI_DIR/shunit2