From b497eec17754b8e23cf96ae521f8d87c0b92fb18 Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Sat, 25 Mar 2017 14:27:47 +0100 Subject: [PATCH] Init --- .test-coverage | 26 ++++++++++++++++++++++++++ .travis.yml | 10 ++++++++++ cmd/rezension/main.go | 20 ++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 .test-coverage create mode 100644 .travis.yml create mode 100644 cmd/rezension/main.go diff --git a/.test-coverage b/.test-coverage new file mode 100644 index 0000000..8bb6ae1 --- /dev/null +++ b/.test-coverage @@ -0,0 +1,26 @@ +#!/bin/bash +# Issue: https://github.com/mattn/goveralls/issues/20 +# Source: https://github.com/uber/go-torch/blob/63da5d33a225c195fea84610e2456d5f722f3963/.test-cover.sh + +echo "mode: count" > profile.cov +FAIL=0 + +# Standard go tooling behavior is to ignore dirs with leading underscors +for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d); +do + if ls $dir/*.go &> /dev/null; then + go test -v -covermode=count -coverprofile=profile.tmp $dir || FAIL=$? + if [ -f profile.tmp ] + then + tail -n +2 < profile.tmp >> profile.cov + rm profile.tmp + fi + fi +done + +# Failures have incomplete results, so don't send +if [ "$FAIL" -eq 0 ]; then + goveralls -service=travis-ci -v -coverprofile=profile.cov +fi + +exit $FAIL diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..047aacf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,10 @@ +language: go +go: + - tip +install: + - go get -t github.com/genofire/hs_master-kss-monolith... + - go get github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover +script: + - ./.test-coverage + - go install github.com/genofire/hs_master-kss-monolith/cmd/rezension diff --git a/cmd/rezension/main.go b/cmd/rezension/main.go new file mode 100644 index 0000000..0e6e7a5 --- /dev/null +++ b/cmd/rezension/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "flag" + "log" +) + +var ( + timestamps bool +) + +func main() { + flag.BoolVar(×tamps, "timestamps", true, "print timestamps in output") + flag.Parse() + + if !timestamps { + log.SetFlags(0) + } + log.Println("Startup rezenssion monolith") +}