November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 11/28/2014 11:35 AM, H. S. Teoh via Digitalmars-d wrote:
> On Fri, Nov 28, 2014 at 11:32:25AM -0800, H. S. Teoh via Digitalmars-d wrote:
>> On Thu, Nov 27, 2014 at 09:05:16PM -0800, Walter Bright via Digitalmars-d wrote:
>>> On 11/27/2014 4:54 PM, H. S. Teoh via Digitalmars-d wrote:
>>>> How do I locally test dmd for coverage? I have a fix for the missing
>>>> coverage for version.c, but I can't figure out how to test whether
>>>> it's actually working.
>>>
>>> In posix.mak for dmd, there's 'make gcov' to generate coverage data.
>>
>> I get a whole bunch of errors that say 'cannot open notes file'. What
>> does that mean?
>>
>> Also, don't I have to first compile dmd with --coverage and run the test
>> suite before it has the coverage data??
> [...]
>
> Which I had tried (make -f posix.mak -j6 MODEL=64 CFLAGS=--coverage),
> but the compilation aborts with:
>
> inifile.c:101:3: error: #error SYSCONFDIR not defined
>
> which goes away when --coverage is not specified. What gives?
I don't know. Haven't tried it in a while, likely it is suffering from bit rot.
|
November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Fri, Nov 28, 2014 at 12:42:06PM -0800, Walter Bright via Digitalmars-d wrote: > On 11/28/2014 11:35 AM, H. S. Teoh via Digitalmars-d wrote: > >On Fri, Nov 28, 2014 at 11:32:25AM -0800, H. S. Teoh via Digitalmars-d wrote: [...] > >>Also, don't I have to first compile dmd with --coverage and run the test suite before it has the coverage data?? > >[...] > > > >Which I had tried (make -f posix.mak -j6 MODEL=64 CFLAGS=--coverage), but the compilation aborts with: > > > > inifile.c:101:3: error: #error SYSCONFDIR not defined > > > >which goes away when --coverage is not specified. What gives? > > I don't know. Haven't tried it in a while, likely it is suffering from bit rot. Nevermind, I found the reason. Make overwrites CFLAGS even if you intended to append to it with `make CFLAGS+=--coverage`, so the other necessary CFLAGS were missing. Gah. Eventually I saw that specifying DEBUG=1 and ENABLE_PROFILING=1 causes the makefile to do the Right Thing(tm), so that's what I did. After that, make gcov does its job. Except it only works if you're in dmd/src, since the top-level makefile has no idea what you're talking about, in spite of the fact that the two makefiles are obviously connected. I hate make so much[1]. :-( [1] http://www.conifersystems.com/whitepapers/gnu-make/ T -- People demand freedom of speech to make up for the freedom of thought which they avoid. -- Soren Aabye Kierkegaard (1813-1855) |
November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
On Fri, Nov 28, 2014 at 01:55:26PM -0800, H. S. Teoh via Digitalmars-d wrote: [...] > Eventually I saw that specifying DEBUG=1 and ENABLE_PROFILING=1 causes the makefile to do the Right Thing(tm), so that's what I did. After that, make gcov does its job. [...] I've added this information to the wiki so that it won't be forgotten again: http://wiki.dlang.org/Building_DMD#DMD_profiling_and_test_coverage T -- Just because you survived after you did it, doesn't mean it wasn't stupid! |
November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | On 11/27/2014 3:32 AM, Martin Nowak wrote: > Actually not too bad :). > > https://dlang.dawg.eu/coverage/ > https://coveralls.io/r/MartinNowak/dmd And quickfur (H.S. Teoh) once again proves how important having coverage testing is! In trying to increase coverage a lurking bug was uncovered and quickly fixed: https://github.com/D-Programming-Language/dmd/pull/4171 |
November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 11/28/2014 2:59 PM, H. S. Teoh via Digitalmars-d wrote:
> I've added this information to the wiki so that it won't be forgotten
> again:
>
> http://wiki.dlang.org/Building_DMD#DMD_profiling_and_test_coverage
Good!
|
November 28, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | "Walter Bright" wrote in message news:m5b044$1bh2$1@digitalmars.com... > And quickfur (H.S. Teoh) once again proves how important having coverage testing is! In trying to increase coverage a lurking bug was uncovered and quickly fixed: > > https://github.com/D-Programming-Language/dmd/pull/4171 Not that fixing it wasn't useful, but that was a minor diagnostic bug that only happens when misusing a feature that nobody uses. |
November 29, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | Plenty of "not covered" lines are actually assert(0)'s. |
November 29, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | On Thursday, 27 November 2014 at 11:32:59 UTC, Martin Nowak wrote:
> Actually not too bad :).
>
> https://dlang.dawg.eu/coverage/
> https://coveralls.io/r/MartinNowak/dmd
Good step.
|
November 29, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Trass3r | On 11/29/2014 4:08 AM, Trass3r wrote: > Plenty of "not covered" lines are actually assert(0)'s. Right, and some of them are also in #ifdef DEBUG / #endif pairs. This is why the code will never reach 100% coverage. But there's still an awful lot we can get covered, and without much effort, either. |
December 06, 2014 Re: dmd test coverage | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | On 11/27/2014 3:32 AM, Martin Nowak wrote: > Actually not too bad :). > > https://dlang.dawg.eu/coverage/ > https://coveralls.io/r/MartinNowak/dmd More tests to improve coverage: https://github.com/D-Programming-Language/dmd/pull/4191 when will this page get updated? https://dlang.dawg.eu/coverage/src/lexer.c.gcov.html |
Copyright © 1999-2021 by the D Language Foundation