github.com/emate/packer@v0.8.1-0.20150625195101-fe0fde195dc6/Makefile (about)

     1  TEST?=./...
     2  VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \
     3           -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
     4  
     5  default: test
     6  
     7  bin:
     8  	@sh -c "$(CURDIR)/scripts/build.sh"
     9  
    10  dev:
    11  	@TF_DEV=1 sh -c "$(CURDIR)/scripts/build.sh"
    12  
    13  # generate runs `go generate` to build the dynamically generated
    14  # source files.
    15  generate:
    16  	go generate ./...
    17  
    18  test:
    19  	go test $(TEST) $(TESTARGS) -timeout=10s
    20  	@$(MAKE) vet
    21  
    22  # testacc runs acceptance tests
    23  testacc: generate
    24  	@if [ "$(TEST)" = "./..." ]; then \
    25  		echo "ERROR: Set TEST to a specific package"; \
    26  		exit 1; \
    27  	fi
    28  	PACKER_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
    29  
    30  testrace:
    31  	go test -race $(TEST) $(TESTARGS)
    32  
    33  updatedeps:
    34  	go get -u github.com/mitchellh/gox
    35  	go get -u golang.org/x/tools/cmd/stringer
    36  	go list ./... \
    37  		| xargs go list -f '{{join .Deps "\n"}}' \
    38  		| grep -v github.com/mitchellh/packer \
    39  		| sort -u \
    40  		| xargs go get -f -u -v
    41  
    42  vet:
    43  	@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
    44  		go get golang.org/x/tools/cmd/vet; \
    45  	fi
    46  	@go tool vet $(VETARGS) . ; if [ $$? -eq 1 ]; then \
    47  		echo ""; \
    48  		echo "Vet found suspicious constructs. Please check the reported constructs"; \
    49  		echo "and fix them if necessary before submitting the code for reviewal."; \
    50  		exit 1; \
    51  	fi
    52  
    53  .PHONY: bin default generate test testacc updatedeps vet