-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to testify & go modules (#21)
- Loading branch information
Showing
13 changed files
with
1,568 additions
and
1,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
SUBPACKAGES=. rfc3164 rfc5424 | ||
help: | ||
@echo "Available targets:" | ||
@echo "- tests: run tests" | ||
@echo "- installdependencies: installs dependencies declared in dependencies.txt" | ||
@echo "- clean: cleans directory" | ||
@echo "- benchmarks: run benchmarks" | ||
GO ?= $(shell which go) | ||
|
||
installdependencies: | ||
@cat dependencies.txt | xargs go get | ||
GO_PKGS ?= $(shell $(GO) list ./...) | ||
|
||
tests: installdependencies | ||
@for pkg in $(SUBPACKAGES); do cd $$pkg && go test -i && go test ; cd -;done | ||
GO_TEST_PKGS ?= $(shell test -f go.mod && $(GO) list -f \ | ||
'{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' \ | ||
$(GO_PKGS)) | ||
|
||
clean: | ||
find . -type 'f' -name '*.test' -print | xargs rm -f | ||
GO_TEST_TIMEOUT ?= 15s | ||
|
||
benchmarks: | ||
@for pkg in $(SUBPACKAGES); do cd $$pkg && go test -gocheck.b ; cd -;done | ||
GO_BENCH=go test -bench=. -benchmem | ||
|
||
all: test | ||
|
||
test: | ||
$(GO) test \ | ||
-race \ | ||
-timeout $(GO_TEST_TIMEOUT) \ | ||
$(GO_TEST_PKGS) | ||
|
||
#XXX: ugly | ||
benchmark: | ||
$(GO_BENCH) | ||
cd rfc3164 && $(GO_BENCH) | ||
cd rfc5424 && $(GO_BENCH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module github.com/jeromer/syslogparser | ||
|
||
go 1.14 | ||
|
||
require github.com/stretchr/testify v1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= | ||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package rfc3164_test | |
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/jeromer/syslogparser/rfc3164" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.