[PATCH] libvirt-tck: add junit output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
having JUnit like XML allows for easy integration into CI tools like
Jenkins. Attach patch adds this using TAP::Formatter::JUnit.
Does this look reasonable?
 -- Guido
>From 85880da3060dfad62183bb7c8ab881a345dacd3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
Date: Mon, 10 Oct 2011 23:39:41 +0200
Subject: [PATCH] Add --format=junit test result output
Status: O
Content-Length: 1489
Lines: 44

for easy integration into e.g. Jenkins. This needs
TAP::Formatter::JUnit.
---
 bin/libvirt-tck |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/libvirt-tck b/bin/libvirt-tck
index ee40743..dcb053c 100644
--- a/bin/libvirt-tck
+++ b/bin/libvirt-tck
@@ -26,6 +26,10 @@ Generate a formal XML document of results
 
  # libvirt-tck --format xml
 
+Generate a JUnit XML document of results
+
+ # libvirt-tck --format junit
+
 =head1 DESCRIPTION
 
 The C<libvirt-tck> (libvirt Technology Compatability Kit) command
@@ -77,7 +81,7 @@ the name of each test case
 Specify the name of the configuration file to use, rather than
 the default C</etc/libvirt-tck/default.cfg>
 
-=item --format text|html|xml
+=item --format text|html|xml|junit
 
 Choose the output format for the test results. The default format
 is C<text>, producing human readable results on the console. The
@@ -192,8 +196,10 @@ if ($format eq "xml") {
     push @newargv, "--formatter=Sys::Virt::TCK::TAP::XMLFormatter";
 } elsif ($format eq "html") {
     push @newargv, "--formatter=TAP::Formatter::HTML"
+} elsif ($format eq "junit") {
+    push @newargv, "--formatter=TAP::Formatter::JUnit"
 } elsif ($format ne "text") {
-    pod2usage(-msg => "unknown format '$format', expecting one of 'text', 'html', or 'xml'\n",
+    pod2usage(-msg => "unknown format '$format', expecting one of 'text', 'html', 'junit' or 'xml'\n",
 	      -exitval => 2,
 	      -output => \*STDERR);
 }
-- 
1.7.6.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]