add test targets to Makefile

This commit is contained in:
Tomas Kral
2016-08-11 11:00:07 +02:00
parent 3dd7689364
commit 6099428364
3 changed files with 34 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
./script/test/cmd/tests.sh
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
set -e
find_dirs() {
(
find . -not \( \
\( \
-path './vendor/*' \
\) -prune \
\) -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./||' | sort -u
)
}
TEST_FLAGS="-tags experimental -cover -coverprofile=cover.out"
if [ -z "$TEST_DIRS" ]; then
TEST_DIRS=$(find_dirs '*_test.go')
fi
TESTS_FAILED=()
set +e
for dir in $TEST_DIRS; do
go test ${TEST_FLAGS} "./${dir}"
done