Open andre2007 opened 5 years ago
To get the filepath the mixin can be enhanced like this
mixin template UnitTest(string filename = __FILE__)
(Thanks to Exil from forum.dlang.org for this tip)
It seems it is not possible to get the filename for D unittests ): ModuleInfo does not contain this info.
There is a pr which will add a new __traits to determine the file location of a given symbol: https://github.com/dlang/dmd/pull/10013
PR was merged and new __traits getloc
is available:
https://dlang.org/changelog/2.088.0.html#getloc
SonarQube has a generic test execution report format [1]
If d-unit could also produce a report in this format, the results can directly be imported into SonarQube.
PS. At the moment SonarQube fails if in attribute "path" a file with extension ".d" is specified. I opened a ticket on SonarQube, they will fix this issue.
[1] https://docs.sonarqube.org/latest/analysis/generic-test/