Revision: a0623eaefaeb
Author:   Janne Härkönen <[email protected]>
Date:     Thu Nov  3 07:30:00 2011
Log:      rebot: write xunit result, error if writing xunit result fails
http://code.google.com/p/robotframework/source/detail?r=a0623eaefaeb

Modified:
 /src/robot/reporting/resultwriter.py
 /src/robot/reporting/xunitwriter.py

=======================================
--- /src/robot/reporting/resultwriter.py        Thu Nov  3 07:17:54 2011
+++ /src/robot/reporting/resultwriter.py        Thu Nov  3 07:30:00 2011
@@ -13,8 +13,10 @@
 #  limitations under the License.

 from robot.common import Statistics
+from robot.errors import DataError
 from robot.output import LOGGER
 from robot.result.builders import ResultFromXML as RFX
+from robot import utils

 from robot.reporting.outputwriter import OutputWriter
 from robot.reporting.xunitwriter import XUnitWriter
@@ -108,7 +110,10 @@
             return
         serializer = XUnitWriter(path)
         try:
-            self.suite.serialize(serializer)
+            self.suite.visit(serializer)
+        except:
+            raise DataError("Writing XUnit result file '%s' failed: %s" %
+                            (path, utils.get_error_message()))
         finally:
             serializer.close()
         LOGGER.output_file('XUnit', path)
=======================================
--- /src/robot/reporting/xunitwriter.py Mon Oct 24 03:12:31 2011
+++ /src/robot/reporting/xunitwriter.py Thu Nov  3 07:30:00 2011
@@ -12,11 +12,11 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

-
+from robot.result.visitor import Visitor
 from robot import utils


-class XUnitWriter:
+class XUnitWriter(Visitor):
     """Provides an xUnit-compatible result file.

     Attempts to adhere to the de facto schema guessed by Peter Reilly, see:

Reply via email to