Description: Modify the test suite to return a suitable error code on failure.
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: http://article.gmane.org/gmane.comp.search.snowball/1191
Last-Update: 2011-08-21

--- a/runtests.py
+++ b/runtests.py
@@ -5,6 +5,10 @@
 py3k = sys.version_info >= (3, 0)
 
 if py3k:
-    doctest.testfile('docs/quickstart_python3.txt')
+    fails, tests = doctest.testfile('docs/quickstart_python3.txt')
 else:
-    doctest.testfile('docs/quickstart.txt')
+    fails, tests = doctest.testfile('docs/quickstart.txt')
+
+if fails > 0:
+    exit(1)
+print('All %i tests passed' % tests)
