* Python for the filters
* 'testtools' (On Debian and Ubuntu systems the 'python-testtools' package,
the testtools package on pypi, or https://launchpad.net/testtools) for
- the extended test API which permits attachments. Version 0.9.2 or newer is
+ the extended test API which permits attachments. Version 0.9.8 or newer is
required. Of particular note, http://testtools.python-hosting.com/ is not
the testtools you want.
* A C compiler for the C bindings
* python-gtk2 if you wish to use subunit2gtk
* python-junitxml if you wish to use subunit2junitxml
* pkg-config for configure detection of supporting libraries.
+
+Binary packages
+---------------
+
+A number of distributions now include subunit, you can try via your package
+manager. The authors maintain a personal package archive on Launchpad::
+ https://launchpad.net/~testing-cabal/+archive/archive
NEXT (In development)
---------------------
+The Subunit Python test runner ``python -m subunit.run`` can now report the
+test ids and also filter via a test id list file thanks to improvements in
+``testtools.run``. See the testtools manual, or testrepository - a major
+user of such functionality.
+
+IMPROVEMENTS
+~~~~~~~~~~~~
+
+* The ``subunit.run`` Python module supports ``-l`` and ``--load-list`` as
+ per ``testtools.run``. This required a dependency bump due to a small
+ API change in ``testtools``. (Robert Collins)
+
+
0.0.6
-----
non-details based test information; this should consistently UTF8 encode such
strings.
+* The Python TestProtocolClient now flushes output on startTest and stopTest.
+ (Martin [gz]).
+
+
0.0.5
-----
def startTest(self, test):
"""Mark a test as starting its test run."""
+ super(TestProtocolClient, self).startTest(test)
self._stream.write("test: %s\n" % test.id())
+ self._stream.flush()
+
+ def stopTest(self, test):
+ super(TestProtocolClient, self).stopTest(test)
+ self._stream.flush()
def progress(self, offset, whence):
"""Provide indication about the progress/length of the test run.
if __name__ == '__main__':
stream = get_default_formatter()
runner = SubunitTestRunner(stream)
- SubunitTestProgram(module=None, argv=sys.argv, testRunner=runner)
+ SubunitTestProgram(module=None, argv=sys.argv, testRunner=runner,
+ stdout=sys.stdout)
else:
extra = {
'install_requires': [
- 'testtools',
+ 'testtools>=0.9.6',
]
}
subunit_start_test "test name"
# determine if test passes or fails
result=$(something)
-if [ $result -eq 0 ]; then
+if [ $result == 0 ]; then
subunit_pass_test "test name"
else
subunit_fail_test "test name" <<END
-#!/bin/sh
+#!/bin/bash
# subunit shell bindings.
# Copyright (C) 2006 Robert Collins <robertc@robertcollins.net>
#
echo 'test: subunit_start_test output'
func_output=$(subunit_start_test "foo bar")
func_status=$?
-if [ $func_status -eq 0 -a "x$func_output" = "xtest: foo bar" ]; then
+if [ $func_status == 0 -a "x$func_output" = "xtest: foo bar" ]; then
echo 'success: subunit_start_test output'
else
echo 'failure: subunit_start_test output ['
subunit_start_test "subunit_pass_test output"
func_output=$(subunit_pass_test "foo bar")
func_status=$?
-if [ $func_status -eq 0 -a "x$func_output" = "xsuccess: foo bar" ]; then
+if [ $func_status == 0 -a "x$func_output" = "xsuccess: foo bar" ]; then
subunit_pass_test "subunit_pass_test output"
else
echo 'failure: subunit_pass_test output ['
END
)
func_status=$?
-if [ $func_status -eq 0 -a "x$func_output" = "xfailure: foo bar [
+if [ $func_status == 0 -a "x$func_output" = "xfailure: foo bar [
something
wrong
here
END
)
func_status=$?
-if [ $func_status -eq 0 -a "x$func_output" = "xerror: foo bar [
+if [ $func_status == 0 -a "x$func_output" = "xerror: foo bar [
something
died
here
-#!/bin/sh
+#!/bin/bash
# subunit shell bindings.
# Copyright (C) 2006 Robert Collins <robertc@robertcollins.net>
#
echo 'test: shell bindings can be sourced'
# if any output occurs, this has failed to source cleanly
source_output=$(. ${SHELL_SHARE}subunit.sh 2>&1)
-if [ $? -eq 0 -a "x$source_output" = "x" ]; then
+if [ $? == 0 -a "x$source_output" = "x" ]; then
echo 'success: shell bindings can be sourced'
else
echo 'failure: shell bindings can be sourced ['
echo 'test: subunit_start_test exists'
found_type=$(type -t subunit_start_test)
status=$?
-if [ $status -eq 0 -a "x$found_type" = "xfunction" ]; then
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
echo 'success: subunit_start_test exists'
else
echo 'failure: subunit_start_test exists ['
echo 'test: subunit_pass_test exists'
found_type=$(type -t subunit_pass_test)
status=$?
-if [ $status -eq 0 -a "x$found_type" = "xfunction" ]; then
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
echo 'success: subunit_pass_test exists'
else
echo 'failure: subunit_pass_test exists ['
echo 'test: subunit_fail_test exists'
found_type=$(type -t subunit_fail_test)
status=$?
-if [ $status -eq 0 -a "x$found_type" = "xfunction" ]; then
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
echo 'success: subunit_fail_test exists'
else
echo 'failure: subunit_fail_test exists ['
echo 'test: subunit_error_test exists'
found_type=$(type -t subunit_error_test)
status=$?
-if [ $status -eq 0 -a "x$found_type" = "xfunction" ]; then
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
echo 'success: subunit_error_test exists'
else
echo 'failure: subunit_error_test exists ['
echo 'test: subunit_skip_test exists'
found_type=$(type -t subunit_skip_test)
status=$?
-if [ $status -eq 0 -a "x$found_type" = "xfunction" ]; then
+if [ $status == 0 -a "x$found_type" = "xfunction" ]; then
echo 'success: subunit_skip_test exists'
else
echo 'failure: subunit_skip_test exists ['