summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Martinelli <stevemar@ca.ibm.com>2014-08-25 17:18:11 -0400
committerSteve Martinelli <stevemar@ca.ibm.com>2014-08-25 17:18:11 -0400
commit48955949b39c5233361f61667c19453a16b4bc0c (patch)
tree72e1f5473854a3a844b11ce6272f36263bad6e8f
parent04689e482eb9168cc0708ab948b971b9f1be098a (diff)
downloadoslotest-48955949b39c5233361f61667c19453a16b4bc0c.tar.gz
Add documentation for running oslo_debug_heler.sh
Removed inline comments from the shell file and added them to the developer docs. Change-Id: Iac0f969165883e173389a42e1bd1b0bc5d513553
-rw-r--r--doc/source/features.rst37
-rw-r--r--doc/source/index.rst1
-rwxr-xr-xtools/oslo_debug_helper.sh10
3 files changed, 38 insertions, 10 deletions
diff --git a/doc/source/features.rst b/doc/source/features.rst
new file mode 100644
index 0000000..c176d01
--- /dev/null
+++ b/doc/source/features.rst
@@ -0,0 +1,37 @@
+==========
+ Features
+==========
+
+Debugging with oslo_debug_helper.sh
+===================================
+
+The oslotest package also distributes a shell file that may be used to assist
+in debugging python code. The shell file uses testtools, and supports debugging
+with `pdb <https://docs.python.org/2/library/pdb.html>`_.
+
+Adding breakpoints to the code
+------------------------------
+
+The typical usage to break into the debugger from a running program is to
+insert:
+
+.. code-block:: python
+
+ import pdb; pdb.set_trace()
+
+Update tox.ini
+--------------
+
+Within the ``tox.ini`` file of your project add the following::
+
+ [testenv:debug]
+ commands = oslo_debug_helper.sh {posargs}
+
+To run with tox:
+
+.. code-block:: bash
+
+ $ tox -e debug
+ $ tox -e debug test_notifications
+ $ tox -e debug test_notifications.NotificationsTestCase
+ $ tox -e debug test_notifications.NotificationsTestCase.test_send_notification
diff --git a/doc/source/index.rst b/doc/source/index.rst
index a05f049..995a840 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -18,6 +18,7 @@ Contents
installation
api
testing
+ features
contributing
Indices and tables
diff --git a/tools/oslo_debug_helper.sh b/tools/oslo_debug_helper.sh
index f681742..e293818 100755
--- a/tools/oslo_debug_helper.sh
+++ b/tools/oslo_debug_helper.sh
@@ -1,15 +1,5 @@
#!/bin/bash
-# To utilize this file, add the following to tox.ini:
-#[testenv:debug]
-#commands = oslo_debug_helper.sh {posargs}
-
-# To run with tox:
-#tox -e debug
-#tox -e debug test_notifications
-#tox -e debug test_notifications.NotificationsTestCase
-#tox -e debug test_notifications.NotificationsTestCase.test_send_notification
-
TMP_DIR=`mktemp -d` || exit 1
trap "rm -rf $TMP_DIR" EXIT