diff --git a/Makefile b/Makefile index 22bef17..15b270e 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ $(EXECUTABLE): src/*.go run: build open $(APPDIR) +test: + go test -v src/*.go + install: cp -r $(APPDIR) /Applications diff --git a/src/main_test.go b/src/main_test.go new file mode 100644 index 0000000..eeb2a4e --- /dev/null +++ b/src/main_test.go @@ -0,0 +1,17 @@ +package main + +import ( + "testing" +) + +func TestIncidents(t *testing.T) { + + logInit("stdout") // Initialize logger + cfg := cfgInit() // read configuration file + pdInit(cfg) // Initialize Pagerduty stuff + + for _, incident := range pdGetIncidents(cfg) { + t.Log(incident) + } + +}