Skip to content

Commit

Permalink
Move counter cli tests into example dir
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Sep 4, 2017
1 parent 21cc189 commit ce46642
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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`"

Expand All @@ -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:
Expand All @@ -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}
Expand Down
14 changes: 14 additions & 0 deletions examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ce46642

Please sign in to comment.