subunit: Update to latest upstream version.
[Samba/wip.git] / lib / subunit / filters / subunit2junitxml
blobd568c71dd4a668cb0857d6d6ee0456bdd3dba252
1 #!/usr/bin/env python
2 # subunit: extensions to python unittest to get test results from subprocesses.
3 # Copyright (C) 2009 Robert Collins <robertc@robertcollins.net>
5 # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
6 # license at the users choice. A copy of both licenses are available in the
7 # project source as Apache-2.0 and BSD. You may not use this file except in
8 # compliance with one of these two licences.
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # license you chose for the specific language governing permissions and
14 # limitations under that license.
17 """Filter a subunit stream to get aggregate statistics."""
20 import sys
21 from subunit.filters import run_filter_script
23 try:
24 from junitxml import JUnitXmlResult
25 except ImportError:
26 sys.stderr.write("python-junitxml (https://launchpad.net/pyjunitxml or "
27 "http://pypi.python.org/pypi/junitxml) is required for this filter.")
28 raise
31 run_filter_script(JUnitXmlResult, __doc__)