diff manage.py @ 51:fabd3f2271fa

Added some basic, incomplete docs on the pymonkey module, which include a doctest that's run when pymonkey is built.
author Atul Varma <varmaa@toolness.com>
date Wed, 08 Jul 2009 09:32:31 -0700
parents 7401af070bb8
children 3570ab12747b
line wrap: on
line diff
--- a/manage.py	Tue Jul 07 09:28:29 2009 -0700
+++ b/manage.py	Wed Jul 08 09:32:31 2009 -0700
@@ -49,7 +49,7 @@
                               os.path.join("docs", "src"),
                               os.path.join("docs", "rendered")])
     if retval:
-        sys.exit(1)
+        sys.exit(retval)
 
 @task
 @cmdopts([("objdir=", "o", "The root of your Mozilla objdir"),
@@ -113,3 +113,16 @@
 
     if result:
         sys.exit(result)
+
+    print "Running doctests."
+
+    # We have to add our current directory to the python path so that
+    # our doctests can find the pymonkey module.
+    new_env['PYTHONPATH'] = os.path.abspath('.')
+    retval = subprocess.call(["sphinx-build",
+                              "-b", "doctest",
+                              os.path.join("docs", "src"),
+                              "_doctest_output"],
+                             env = new_env)
+    if retval:
+        sys.exit(retval)