Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add debug option processing to run_tests

This just adds -d|--debug option so you can debug
using tools like pdb again and to get extra output
from the tests.

Change-Id: Icebc17a1575e17cfd9597581546dca4732b9a8ef
  • Loading branch information...
commit 704cae0b00cd589413911689f992a63e3bd56650 1 parent 020778d
@j-griffith j-griffith authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 run_tests.sh
View
16 run_tests.sh
@@ -32,6 +32,7 @@ function process_option {
-p|--pep8) just_pep8=1;;
-P|--no-pep8) no_pep8=1;;
-c|--coverage) coverage=1;;
+ -d|--debug) debug=1;;
-*) testropts="$testropts $1";;
*) testrargs="$testrargs $1"
esac
@@ -50,6 +51,7 @@ wrapper=""
just_pep8=0
no_pep8=0
coverage=0
+debug=0
LANG=en_US.UTF-8
LANGUAGE=en_US:en
@@ -73,6 +75,20 @@ function run_tests {
# Cleanup *pyc
${wrapper} find . -type f -name "*.pyc" -delete
+ if [ $debug -eq 1 ]; then
+ if [ "$testropts" = "" ] && [ "$testrargs" = "" ]; then
+ # Default to running all tests if specific test is not
+ # provided.
+ testrargs="discover ./tests"
+ fi
+ ${wrapper} python -m testtools.run $testropts $testrargs
+
+ # Short circuit because all of the testr and coverage stuff
+ # below does not make sense when running testtools.run for
+ # debugging purposes.
+ return $?
+ fi
+
if [ $coverage -eq 1 ]; then
# Do not test test_coverage_ext when gathering coverage.
if [ "x$testrargs" = "x" ]; then
Please sign in to comment.
Something went wrong with that request. Please try again.