Author: laukpe
Date: Wed Sep 24 09:29:46 2008
New Revision: 820

Modified:
   trunk/proto/remote/run_tests.py

Log:
some support for runnign remote server on jython (not ready yet) and a bit of cleanup

Modified: trunk/proto/remote/run_tests.py
==============================================================================
--- trunk/proto/remote/run_tests.py     (original)
+++ trunk/proto/remote/run_tests.py     Wed Sep 24 09:29:46 2008
@@ -8,7 +8,7 @@
 class Library:

     def __init__(self, lang):
-        ext = {'python': 'py', 'ruby': 'rb', 'perl': 'pl'}[lang]
+ ext = {'python': 'py', 'jython': 'py', 'ruby': 'rb', 'perl': 'pl'}[lang]
         cmd = '%s %s/examplelibrary.%s' % (lang, lang, ext)
         stdin, self._stdout, self._stderr = os.popen3(cmd)
         stdin.close()
@@ -25,14 +25,15 @@
     if len(sys.argv) < 2:
         raise "Will get an usage here..."
     lang = sys.argv[1]
-    lib = Library(lang)
+    include = lang if lang != 'jython' else 'python'
     args = 'test' if len(sys.argv) == 2 else ' '.join(sys.argv[2:])
+    lib = Library(lang)
     os.system('pybot --log none --report none --output logs/output.xml '
-              '--name %s --include %s %s' % (lang, lang, args))
+              '--name %s --include %s %s' % (lang, include, args))
     lib.stop()
     os.system('../../tools/statuschecker/statuschecker.py logs/output.xml')
-    rc = os.system('rebot --outputdir logs logs/output.xml')
+    rc = os.system('rebot --outputdir logs logs/output.xml') >> 8
     if rc == 0:
         print 'All tests passed'
     else:
-        print '%d test(s) failed' % (rc >> 8)
+        print '%d test%s failed' % (rc, 's' if rc != 1 else '')

Reply via email to