Hi,
I am QA guy and beginner in C,C++ unit testing.
Please help.
Working on Ubuntu 14.04 64 bit.
Created sample cpp class and a corresponding Test.cpp.
Have been able to create the .xml output file for the CPPUnit tests run using XmlOutputter.
But how to get the HTML report using this xml, is there any predefined XSL, DTD or something like that (as in case of CUnit), so that if these files are there in the same directory as the CPPUnit generated XML file then it would simply show an HTML report.
OR
Some way by which ANT can be used to generate the HTML report similar to JUnit.
Referred
But could not understand well as variable and paths assumed I am not sure of and new to ANT build.xml etc. too.
It is in closed status and the guideline is given at a high level, if someone can help
1 - provide the XSLT, DTD or whatever that needs to be just copied to the folder where CPPUnit generated test run report XML is there and the HTML would get displayed
OR
2 - build.xml with the required variables (to be able to understand the directories and paths assumed in the example given) and targets that can be actually used with ANT to generate JUnit like report
Appreciate your patience to read through.
Thanks in advance
The feature you want is already implemented. I have Ubuntu, but do not develop on it. As a Windows developer, here is a script I use during my build process to create html output. You will need to translate to your environment. The output file I generate here is "UnitTestResults.xml", which is html internally. You can probably pick a different name. :-)
@echo off
setlocal enabledelayedexpansion
@rem Expected parameters
@rem
@rem param1: location of targets for the solution (not the project)
@rem param2: [optional] if non-blank, the unit test target (else all we can find)
@rem Determine if we are running debug or release (or other)
cd %1
set where=%cd%
set where=%where:Debug=xx%
set build=Debug
if "%cd%" == "%where%" set build=Release
@rem identify all files ending in _test.dll and _unittest.dll
set params=%2
if "%params%" NEQ "" goto :skipparams
dir /b _test.dll > filelist.tmp 2> NUL
dir /b _unittest.dll >> filelist.tmp 2> NUL
for /f "usebackq delims=" %%a in (filelist.tmp) do set params=!params! %%a
del filelist.tmp
:skipparams
goto %build%
:debug
@rem del /Q "UnitTestResults.xml"
echo DllPlugInTesterd_dll.exe -c -x UnitTestResults.xml -s UnitTestReport.xsl clockerplugind.dll %params%
DllPlugInTesterd_dll.exe -c -x UnitTestResults.xml -s UnitTestReport.xsl clockerplugind.dll %params%
goto :EOF
:release
@rem del /Q "UnitTestResults.xml"
echo DllPlugInTester_dll.exe -c -x UnitTestResults.xml -s UnitTestReport.xsl clockerplugin.dll %params%
DllPlugInTester_dll.exe -c -x UnitTestResults.xml -s UnitTestReport.xsl clockerplugin.dll %params%
goto :EOF
:EOF