summaryrefslogtreecommitdiffstats
path: root/run_tests.sh
diff options
context:
space:
mode:
authorJoris Roovers <jroovers@cisco.com>2016-12-03 18:04:20 +0100
committerJoris Roovers <jroovers@cisco.com>2016-12-03 18:04:20 +0100
commit4328c5a968b5dbfaa5e3be98f34b155b61141d15 (patch)
tree967c4d0d1a7eaa7b1172d315b7552e94bc5f3783 /run_tests.sh
parent2d323a9efcc9abda70316282545d5e505a83c1ac (diff)
./run_tests.sh --exec allows for easy command executing in virtualenvs
This makes it easy to quickly check or do something in all the virtualenvs.
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-xrun_tests.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/run_tests.sh b/run_tests.sh
index a02e4bd..ef11dd9 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -16,7 +16,7 @@ help(){
echo " --all-env Run all tests against all python environments"
echo " --install Install virtualenvs for the --envs specified"
echo " --uninstall Remove virtualenvs for the --envs specified"
- echo " --switch Switch environments (as per --envs)"
+ echo " --exec [CMD] Execute [CMD] in the --envs specified"
echo " -s, --stats Show some project stats"
echo " --no-coverage Don't make a unit test coverage report"
echo ""
@@ -206,8 +206,10 @@ just_all=0
just_clean=0
just_install=0
just_uninstall=0
+just_exec=0
include_coverage=1
envs="default"
+cmd=""
testargs=""
while [ "$#" -gt 0 ]; do
@@ -221,6 +223,7 @@ while [ "$#" -gt 0 ]; do
-i|--integration) shift; just_integration_tests=1;;
-a|--all) shift; just_all=1;;
-e|--envs) shift; envs="$1"; shift;;
+ --exec) shift; just_exec=1; cmd="$1"; shift;;
--install) shift; just_install=1;;
--uninstall) shift; just_uninstall=1;;
--all-env) shift; envs="all";;
@@ -264,6 +267,9 @@ for environment in $envs; do
elif [ $just_clean -eq 1 ]; then
switch_env "$environment"
clean
+ elif [ $just_exec -eq 1 ]; then
+ switch_env "$environment"
+ eval "$cmd"
elif [ $just_uninstall -eq 1 ]; then
assert_specific_env "$environment"
uninstall_virtualenv "$environment"