summaryrefslogtreecommitdiff
path: root/service/go
diff options
context:
space:
mode:
authorTiago Ferraz <tiago.ferraz@gmail.com>2015-02-12 11:44:04 -0200
committerTiago Ferraz <tiago.ferraz@gmail.com>2015-02-12 11:48:34 -0200
commit1b7a10b5643d7d833df2fb5627921fedde1ceaa2 (patch)
tree9f0063c4707c269e7a43675cd6caa0b0677c83e6 /service/go
parent9455d7e338b93517bfd00903cb286e79b2023244 (diff)
Adding Coverage Commands to service/go
Added unit and integration coverage generation command and a combination of both coverage in go script.
Diffstat (limited to 'service/go')
-rwxr-xr-xservice/go42
1 files changed, 42 insertions, 0 deletions
diff --git a/service/go b/service/go
index 308e4f02..ac953bdd 100755
--- a/service/go
+++ b/service/go
@@ -1,6 +1,11 @@
#!/bin/bash
NUM_OF_CORES=''
+TRIAL_PATH=''
+
+function getTrialAbsolutePath {
+ TRIAL_PATH="$(which trial)"
+}
function resolveNumOfCores {
if [ "$(uname)" == "Darwin" ]; then
@@ -56,6 +61,37 @@ function runJSHint {
echo "Done."
}
+function runCoverageUnit {
+ echo "Generating Unit Test Converage Information."
+ coverage erase
+ getTrialAbsolutePath
+ coverage run -p --source=pixelated $TRIAL_PATH --reporter=text $* test.unit
+ coverage combine
+ coverage html
+ echo "Done."
+}
+
+function runCoverageIntegration {
+ echo "Generating Integration Test Converage Information."
+ coverage erase
+ getTrialAbsolutePath
+ coverage run -p --source=pixelated $TRIAL_PATH --reporter=text $* test.integration
+ coverage combine
+ coverage html
+ echo "Done."
+}
+
+function runCoverageUnitAndIntegration {
+ echo "Generating Unit and Integration Test Converage Information."
+ coverage erase
+ getTrialAbsolutePath
+ coverage run -p --source=pixelated $TRIAL_PATH --reporter=text test.unit
+ coverage run -p --source=pixelated $TRIAL_PATH --reporter=text test.integration
+ coverage combine
+ coverage html
+ echo "Done."
+}
+
if [ "$1" == 'test' ]; then
runJSHint
runPep8
@@ -74,6 +110,12 @@ elif [ "$1" == 'setupjs' ]; then
elif [ "$1" == 'setup' ]; then
setupjs
setuppy "${@:2}"
+elif [ "$1" == 'coverage_unit' ]; then
+ runCoverageUnit "${@:2}"
+elif [ "$1" == 'coverage_integration' ]; then
+ runCoverageIntegration "${@:2}"
+elif [ "$1" == 'coverage_all' ]; then
+ runCoverageUnitAndIntegration "${@:2}"
elif [ "$1" == 'start' ]; then
/usr/bin/env pixelated-user-agent "${@:2}"
else