Convert Google test XML report to HTML (console) - html

I need an example (in some console tool) to convert generated gtest XML report to HTML.
A solution mast be without using ant or Maven.

you should use xslt to transform xml into html.
you could use the xsltproc tool from the command line under linux. I guess there are equivalent tools for other OSes.

I did it for myself with programming language, which is Python 2.*: https://github.com/burlachenkok/gtest_report
Also this gtest_report supports comparision of 2 or more google test results.
If to be honest it was the prime goal.

Related

NUnit to JUnit for NUnitLite Runner

I'm using NUnitLite runner in console application (according to this example) to run my test on linux/mac.
I need to transform the results into JUnit format. I haven't found any flag/option how I can do the transformation only by using NUnitLite runner.
Another way would be to transform the results after the test run. I found xslt transformation here, but I'm not sure, how to use it on linux/mac (I don't want to use mono in this case).
Did I miss something in NUniteLite runner or is there a simple way to run xslt transformation on linux/mac I could use?
Thanks a lot
OK, it's not universal, but worked for me on linux(Ubuntu)/mac:
xsltproc -o PATH_TO/JUNIT_FILE.xml PATH_TO/nunit3-junit.xslt PATH_TO/TestResult.xml
Where "nunit3-junit.xslt" comes from nunit /
nunit-transforms
and for more info about xsltproc see here.

How to generate junit output with nosetests?

I have some tests I would like to run with nosetests and generate junit xml results. As far as I know, this is not possible by the default installation of nosetests, as it only produced xunit xml files.
However, nose plugins exist which can do various things, among them a code snippet to be use to create junit xml output.
My questions:
What are the differences between junit and xunit xml results? Are they basically different and incompatible?
How to install or use the junitxml plugin code in the link I mentioned above? Maybe there is a different way to create junit output?
Nose supports xunit natively, now.
nose supports xunit output with built-in plugin, just try --with-xunit
~ From Oleksiy, https://stackoverflow.com/a/20750012/311901
This is a nose plugin; You can install it by
pip install NoseXUnit
Read the documentation for it here: http://nosexunit.sourceforge.net/. This will help you run the plugin

XML2HTML tools?

I need to transform XML file into HTML.
What options do I have? Is there any python tool for it?
ADDED
On my mac, I found xsltproc, and I could run it as follows
xsltproc xslt.xml hello.xml
Generally speaking, XSLT is for various XML translations. I'm sure you can find Python library for it.

Running XSLT on servers?

Currently I am working on a project for a client that compares the difference between two XML files, generates an XML that lists the differences (i.e. if a part in an inventory was <Added>, <Deleted>, or <Modified>) and displays a report in HTML.
I have three transforms that basically transform large vendor-specific XML files to simple generic XML files (schema defined). These generic XML files are then transformed into one generic XML file that shows the differences and then that is transformed to a report.html for display for the user.
Presently for testing, I invoke a .bat file to run all three transforms (using Saxon8.jar). My question is, is it possible to put these transforms on a server and create a HTML page with a one-click action that will let the user upload the vendor-specific XML files, transform them, and display the generated HTML file to the user?
You haven't specified whether you'll be using php, java or ASP.NET, however, the functionality you're looking for is possible in all three cases. Your backend web app should have the necesssary mechanism to accept the file uploaded by the user, save it in some work folder, run the necessary transformation using your chosen language, Jave, C#, php etc. and then write back the HTML.
Is it possible? Yes.
To do it you'd typically use some server-side technology (php, ruby, java) to perform the transforms.
But browser-side XSLT is possible, too.
Apache Cocoon is a powerful XML processing engine.
If you're just doing this one job, then coding a Java servlet to do it is not too difficult. If you're doing lots of similar things, a framework like Cocoon or Orbeon will save you effort in the long run.

Is there a good tool for XSL previews?

I'm a LAMP web developer in Perl and at my current place we use some black magic in using Perl to retrieve the data, throw them into a XML and then pass the XML to an XSL file. And this is all handled magically by the almighty AxKit. Thus you can probably imagine that my XSL is full of XSLT lines, i.e. if test,#value etc.
I was wondering if there's any tool, IDE, etc which I can use to open the XSL file and check the HTML preview without having to modify anything in my current XSL?
I'm open for suggestions as long as it gets the job done. Thanks.
XSLT IDEs (Interactive Development Environments):
XSelerator (the one I've been using for 6-7 years). Free, has a Debugger for MSXML, has intellisense for both XSLT 1.0 and XSLT 2.0. In addition has some dynamic intellisense. The debugger has breakpoints, data breakpoints,visualizes temporary trees, variables, test conditions, current output, ..., etc.
VS2008 -- a good XML Editor + XSLT Debugger. Good static intellisence. Match patterns are statically checked. Breakpoints, data breakpoints, visualization of variables and the current output.
oXygen
XML-SPY (Altova)
Stylus Studio
XPath tools:
Update:
Both the IE and the FF versions of the XPath Visualizer have now a new, safe home, thanks to the hospitality of Lars Huttar. The links below point to the new, safe site.
The XPath Visualizer -- A popular IE-based tool for learning XPath and FF-based, too, by playing with XPath expressions. Free and open source. Allows any XPath expression to be evaluated against a given XML document and displayes the results hi-lighted in the xml document (if they are node(s)) or in a separate box (if the results are atomic values). Allows xsl:variable-s to be defined and then used in XPath expressions. Allows xsl:key-s to be defined and then referenced by key() functions within XPath expressions.
I am currently using Visual Studio, open your xml file within visual studio, from XML menu click show xslt output.
I found Stylus Studio to be an invaluable tool for all my XML needs. I never ran it rough Wine though.
I use cooktop which is free.
Try Microsoft XML Notepad
I'm using Visual Web Developer 2008 Express Edition...under my XML menu all I see is "Schemas..." when I have an XSL file open. Did I miss installing a component for the other options?
A couple of alternatives that haven't been mentioned, yet:
XML Copy Editor - Okay, but requires an intermediate step to generate HTML and then open HTML in an external browser.
WMHelp XMLPad - Many minor bugs and annoyances, but otherwise very useful: can review and debug transformations within the IDE.
I wrote a post describing these and a couple of other tools, in case someone is interested: How to test XSL transformations.