For the implementation of [bugs:#30]:
Please write a technical design for the integration of test coverage reports into SASUnit: Consider logging of coverage information during execution phase, formatting of a coloured source code listing and placement of a coverage indicator and the source code listing into the SASUnit reporting environment. The solution can be dependant on SAS 9.3 and higher, using the new macro trace options.
Anonymous
The basic principle for the integration of test coverage assessment into SASUnit is the utilization of the MCOVERAGE and MCOVERAGELOC system options available in SAS 9.3. If the MCOVERAGE system option is activated, a coverage analysis text file is generated that logs which lines of macro code are executed while the SAS system executes source code. The MCOVERAGELOC option determines where the coverage analysis text file is generated.
Using these system options, test coverage (more precisely statement coverage) reports can be integrated in SASUnit with the following modifications:
initsasunit.sas
_sasunit_loadEnvironment.sas
runSASUnit.sas
Implement New macro saspgm\sasunit_sasunit_reporttcghtml.sas (prototype implementation available as an attachment, please see below):
The macro takes a macro source code file and a coverage analysis text file generated with the MCOVERAGE option. Using the data of the coverage analysis text file, a html file is generated out of the macro source code file, in which the covered lines of code and the non-covered lines of code are highlighted with bright colours and the non contributing lines are shown in grey. In addition, the percentage of covered lines is written in a headline of the html file. Further implementation details are described in the available prototype implementation file.
_sasunit_reportAutonHTML.sas
This is done in order to get one file containing coverage data of all calls to the macros under test
Last edit: Patrick Warnat 2012-10-05