minor test cleanup; add "make stats" target to run cloc against project
This commit is contained in:
1 parent
828d776b94
commit
8a6cac5df0
2 files changed
+5
-3
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
# derived from: http://zduck.com/2014/go-project-structure-and-dependencies/
|
# derived from: http://zduck.com/2014/go-project-structure-and-dependencies/
|
||||||
|
|
||||||
# build targets (which aren't files)
|
# build targets (which aren't files)
|
||||||
.PHONY: build fmt lint vet test autotest cover doc run clean env vendor
|
.PHONY: build fmt lint vet test autotest cover doc run clean env stats vendor
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
APPNAME := docrawler
|
APPNAME := docrawler
|
||||||
@@ -26,8 +26,8 @@ build: fmt lint vet
|
|||||||
fmt:
|
fmt:
|
||||||
go fmt ./src/...
|
go fmt ./src/...
|
||||||
|
|
||||||
|
# TODO golint is not accepting the "./src/..." for some reason (from within make)
|
||||||
lint:
|
lint:
|
||||||
# TODO golint is not accepting the "./src/..." for some reason (from within make)
|
|
||||||
golint ./src/${APPNAME}/*.go
|
golint ./src/${APPNAME}/*.go
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
@@ -55,6 +55,9 @@ clean:
|
|||||||
env:
|
env:
|
||||||
go env
|
go env
|
||||||
|
|
||||||
|
stats:
|
||||||
|
cloc ./src
|
||||||
|
|
||||||
# vendor
|
# vendor
|
||||||
# * wipes our vendor directory completely
|
# * wipes our vendor directory completely
|
||||||
# * fetches all packages in ${PACKAGES} (GOPATH hardcoded to vendor directory only)
|
# * fetches all packages in ${PACKAGES} (GOPATH hardcoded to vendor directory only)
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ func TestSimpleFetch(t *testing.T) {
|
|||||||
// TestSimpleMap figures out the site map for the site in baseURL
|
// TestSimpleMap figures out the site map for the site in baseURL
|
||||||
func TestSimpleMap(t *testing.T) {
|
func TestSimpleMap(t *testing.T) {
|
||||||
pages := docrawl(baseURL)
|
pages := docrawl(baseURL)
|
||||||
t.Log("pages = ", pages)
|
|
||||||
if len(pages) != 4 {
|
if len(pages) != 4 {
|
||||||
t.Logf("got %v, wanted %v\n", len(pages), 1)
|
t.Logf("got %v, wanted %v\n", len(pages), 1)
|
||||||
t.Fatal("got wrong number of pages")
|
t.Fatal("got wrong number of pages")
|
||||||
|
|||||||
Reference in new issue
Block a user