From 0e7f1100e332d2564a2508894fbe226d98d992fb Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 9 Apr 2018 10:46:39 -0700 Subject: [PATCH] cover: move coverage test script to "tests" Signed-off-by: Gyuho Lee --- test | 2 +- cover => tests/cover.test.bash | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) rename cover => tests/cover.test.bash (71%) diff --git a/test b/test index aab75145a..cc94244ac 100755 --- a/test +++ b/test @@ -46,7 +46,7 @@ fi USERPKG=${PKG:-} -# Invoke ./cover for HTML output +# Invoke ./tests/cover.test.bash for HTML output COVER=${COVER:-"-cover"} # Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt. diff --git a/cover b/tests/cover.test.bash similarity index 71% rename from cover rename to tests/cover.test.bash index b7ad39113..eb089a4d2 100755 --- a/cover +++ b/tests/cover.test.bash @@ -1,13 +1,18 @@ #!/usr/bin/env bash # # Generate coverage HTML for a package -# e.g. PKG=./unit ./cover +# e.g. PKG=./unit ./tests/cover.test.bash # set -e +if ! [[ "$0" =~ "tests/cover.test.bash" ]]; then + echo "must be run from repository root" + exit 255 +fi + if [ -z "$PKG" ]; then - echo "cover only works with a single package, sorry" - exit 255 + echo "cover only works with a single package, sorry" + exit 255 fi COVEROUT="coverage"