Skip to content

Commit

Permalink
Made it so the 'g' stub can run the external coverage itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
CleanCut committed May 21, 2014
1 parent 4dd2858 commit 46582e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ install:
- "pip install -r requirements.txt"
- "pip install coveralls"
script:
- "./g -vvv"
- "coverage run --source green --omit '*/test*,*examples*' -m green.cmdline"
- "./g cov no_delete -vvv"
after_success: coveralls
26 changes: 25 additions & 1 deletion g
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
#!/usr/bin/env bash

# USAGE
#
# ./g [python version] [cov [no_delete]] [green options]

# If the first argument is a version number, use it to run that version of python
PYTHON=python
if [[ -e `which python$1` ]] ; then
PYTHON=python$1
shift
fi

$PYTHON -c 'from green.cmdline import main ; main()' $@
# If the next argument is "cov", run coverage externally
if [[ $1 == "cov" ]] ; then
shift
if [[ $1 == "no_delete" ]] ; then
shift
DELETE="no"
else
DELETE="yes"
fi
coverage run --source green --omit '*/test*,*examples*' -m green.cmdline $@
echo ""
coverage report -m
if [[ $DELETE == "yes" ]] ; then
rm .coverage
fi
exit
fi


# Run the command-line version of green
$PYTHON -m green.cmdline $@

0 comments on commit 46582e5

Please sign in to comment.