-
Notifications
You must be signed in to change notification settings - Fork 1
DTest and CodeCoverage
DTest has an option to analyze CodeCoverage while running tests. The subject of the Coverage analysis could be the source code that was tested as well as the tests themselves. Coverage itself does not say anything about correctness of code or tests, but it could be a useful metric and is definitely useful to ensure that tests really challenge all parts of the code they are testing.
Kai Jäger has written an excellent tool for this purpose: CodeCoverage. It is used internally by DTest. (details in next section)
The easiest way to perform a coverage analysis is by simply using the switch -coverage
when launching DTest.
However, if you want to run a number of tests repeatedly, it is recommended to do this by setting up a .dyalogtest
file which provides additional settings for coverage analysis.
If DTest is able to get it using Tatin, it will dynamically be brought in. Otherwise, you'll need to provide a local copy yourself:
- download the required version (see initial code in DyalogBuild.dyalog that assigns variable "CodeCoverage" with that version) from Kai's repository.
- copy the CodeCoverage folder into MyUCMDs
- or place it elsewhere and set up a config variable "CODECOVERAGE_PATH" that points to the path