Search code examples
junitnunit

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


Solution

  • 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.