[Piglit] [PATCH v2 0/5] Add support for subtests in JUnit as nested testsuite elements

Dylan Baker dylan at pnwbakers.com
Tue Aug 23 00:03:47 UTC 2016

This series refactors the JUnit backend so that the _write attribute is
actually a callable class, instead of a method. This gives greater
flexibility to handle subtests in the JUnit, or continue ignoring them.

The reason to ignore them is that some xUnit implementations don't
handle them properly (the JUnit plugin for Jenkins does not, for
example, while the xUnit plugin does). Since piglit has a more than one
consumer of the JUnit backend, it makes sense to be able to select the
new backend or not.

To enable this features add the --junit-subtests switch to the command
line (obviously when using the junit backned), and watch magic happen.
Each test with subtests will be recorded as a testsuite element, and the
stderr and stdout will be attached to the testsuite rather than the
testcase. However, when using the xUnit plugin for Jenkins it is
rendered correctly.

Dylan Baker (5):
  framework: fix PIGLIT_NO_FAST_SKIP.
  framework/backends/junit.py: Split _write into a separate class.
  framework/backends/junit.py: Add a writer class that handles subtests
  framework: add command line switch to enable junit subtests
  framework/backends/junit: Don't let skip hide status changes

 framework/backends/junit.py                | 351 ++++++++++++++--------
 framework/programs/run.py                  |   8 +-
 framework/test/opengl.py                   |   6 +-
 unittests/framework/backends/test_junit.py | 171 ++++++++++-
 unittests/framework/test/test_opengl.py    |  41 +++-
 5 files changed, 437 insertions(+), 140 deletions(-)

git-series 0.8.7

More information about the Piglit mailing list