[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jun 1 11:00:41 CDT 2011


branch "review" has been updated
       via  c19d0d7b2126bfcc05008dd5d286e7e700fdca69 (commit)
      from  7ff554c8a2572d2bf71adcfbd80c2f4a22dcf2fb (commit)

Summary of changes:
 testsuite.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


- Log -----------------------------------------------------------------
commit c19d0d7b2126bfcc05008dd5d286e7e700fdca69
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 1 11:00:39 2011 -0500

    output xml data to a file

diff --git a/testsuite.py b/testsuite.py
index 91f97d1..cf17c7c 100755
--- a/testsuite.py
+++ b/testsuite.py
@@ -113,7 +113,11 @@ class __main__:
                                 print >> sys.stderr, '   |- Test "' + testName + '" - FAILED!\n    \- No test data defined!'
                                 subTestElement, errorMsgs = xml().addFailure(subTestElement, ['No test data defined!'])
                                 break
+
         print >> sys.stderr, "\n\n" + xml().prettyXml(x)
+        results = file().write('testsuite_results.xml', xml().prettyXml(x))
+        if results['success'] == False:
+            print >> sys.stderr, 'Unable to generate XML test results file.'
         return
 
 class plugins:
@@ -196,4 +200,16 @@ class xml:
         element.set(key, '%s' % val)
         return element
 
+class file:
+    def write(self, fn, fd):
+        try:
+            f = open('%s/%s' % (cwd, fn), 'w')
+        except IOError:
+            return {'success':False, 'msg':'Failed to open test results output file: %s/tmp/%s' % (cwd, fn)}
+        except:
+            return {'success':False, 'msg':'Unexpected error: %s' % sys.exc_info()[0]}
+        f.write(fd)
+        f.close()
+        return {'success':True}
+
 __main__()

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list