diff options
| author | Shulhan <ms@kilabit.info> | 2018-05-17 05:57:17 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-05-17 05:57:17 +0700 |
| commit | b6e72ab41aa1ab207cb255d38158271634e558ae (patch) | |
| tree | dd10d2b3044990f99d6d310cd5370d65e07c6fee | |
| parent | 7dfb98090b2256d87c34eb842ff669724694ecde (diff) | |
| download | beku-b6e72ab41aa1ab207cb255d38158271634e558ae.tar.xz | |
make: add task to run test with cpu and memory profiling
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | Makefile | 12 |
2 files changed, 12 insertions, 3 deletions
@@ -1,2 +1,5 @@ +/beku.test /cover.html /cover.out +/cpu.prof +/mem.prof @@ -5,10 +5,13 @@ SRC:=$(shell go list -f '{{$$d:=.Dir}} {{ range .GoFiles }}{{$$d}}/{{.}} {{end}}' ./...) SRC_TEST:=$(shell go list -f '{{$$d:=.Dir}} {{ range .TestGoFiles }}{{$$d}}/{{.}} {{end}}' ./...) -COVER_OUT=cover.out -COVER_HTML=cover.html +COVER_OUT:=cover.out +COVER_HTML:=cover.html +CPU_PROF:=cpu.prof +MEM_PROF:=mem.prof -.PHONY: all install test coverbrowse lint +.PHONY: all install lint +.PHONE: test test.prof coverbrowse all: install @@ -17,6 +20,9 @@ install: test test: $(COVER_HTML) +test.prof: + go test -cpuprofile $(CPU_PROF) -memprofile $(MEM_PROF) . + $(COVER_HTML): $(COVER_OUT) go tool cover -html=$< -o $@ |
