|
Project Information
Featured
Downloads
Links
|
Delphi Code CoverageIntroductionDelphi Code Coverage is a simple Code Coverage tool for Delphi that creates code coverage reports based on detailed MAP files. Please also check out this project http://code.google.com/p/delphi-code-coverage-wizard/ as it adds a wizard to the Delphi IDE to help create configuration and launch Delphi Code Coverage. PreconditionsThe project you want to run a code coverage report for must have a "debug" configuration that generates a Detailed MAP file. What kind of code coverage does it doDelphi Code Coverage currently only measures "line coverage", i.e. it will track each line that code was generated for and mark it if it was executed. Coverage of DLLs and BPLsFor applications who uses Borland Package Libraries (which are essentially DLLs) or external DLLs, DCC will attempt to load a .map file for each DLL and if it exists and units in those libraries are part of the covered units, code coverage will span the DLL/BPL loaded as part of the application. The .map file need to exist in the same directory as the dll that was loaded. UsageDownload http://code.google.com/p/delphi-code-coverage/downloads/detail?name=CodeCoverage_0.5.zip, unzip the file and put it for example in your Delphi installations "bin" directory or somewhere where it is in the "path". You may also want to try out the release candidate version for 1.0 - http://code.google.com/p/delphi-code-coverage/downloads/detail?name=CodeCoverage_1.0_RC2.zip. Open a command line prompt in the directory where your compiled application and executable is. Type: CodeCoverage -m TestApp.map -e TestApp.exe -u TestUnit TestUnit2 -xml -html OutputHTML output (specify -html as a parameter)For each unit there will be a unit.html with a summary of the coverage, followed by the source marked up. Green lines were covered. Red lines were not covered lines. The other lines didn't have code generated for it. There is also a CodeCoverage_summary.html file that summarizes the coverage and has links to the generated unit reports. XML output (specify -xml as a parameter)A summary xml report called CodeCoverage_summary.xml is generated in the output directory that is compatible with the xml output from EMMA. Emma output (specify -emma as a parameter)It is now possible to create EMMA compatible output which allows for using emma to merge multiple code coverage runs as well as using emma for generating reports. Delphi compatibilityDCC is compatible with Delphi 2010, XE and XE2 (32-bit), Delphi 2006, Delphi 5. If you find that it works for other Delphi versions, please let us know so that we can add to the list. Hudson integrationYou can integrate the xml report using the Hudson EMMA plugin. The html report can be integrated using the HTML Publisher plugin. SponsorsThe 1.0 release was made possible through the generous support of DevFactory. InspirationThis project was inspired by great tools in the Java world such as Emma. This project has been lingering in an unfinished form on my harddrive for more than a year. Finally it slipped out. Switches
Version history1.0 RC 2
1.0 RC 1
1.0 Beta 3
1.0 Beta 2
1.0 Beta 1
0.5
0.4
0.3
0.2
0.1
|