[kupfer] wscript: 'test' target to run all doctests



commit f7738142d8293fb6ddfae4863cbfc4f35a65f5c3
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Sep 23 12:25:25 2009 +0200

    wscript: 'test' target to run all doctests

 wscript |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/wscript b/wscript
index 569a123..0334066 100644
--- a/wscript
+++ b/wscript
@@ -192,6 +192,17 @@ def intlupdate(util):
 			os.popen("intltool-update %s" % lang)
 			os.popen("msgfmt --check %s" % lang_file)
 
+def test(bld):
+	# find all files with doctests
+	paths = os.popen("git grep -l 'doctest.testmod()' kupfer/").read().split()
+	all_success = True
+	for p in paths:
+		print p
+		res = os.popen("python '%s'" % p).read()
+		print (res or "OK")
+		all_success = all_success and bool(res)
+	return all_success
+
 def shutdown():
 	pass
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]