www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd test coverage

reply Martin Nowak <code+news.digitalmars dawg.eu> writes:
Actually not too bad :).

https://dlang.dawg.eu/coverage/
https://coveralls.io/r/MartinNowak/dmd
Nov 27 2014
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 11/27/14 3:32 AM, Martin Nowak wrote:
 Actually not too bad :).

 https://dlang.dawg.eu/coverage/
 https://coveralls.io/r/MartinNowak/dmd
Wow, coveralls.io looks pretty nice! -- Andrei
Nov 27 2014
parent Martin Nowak <code+news.digitalmars dawg.eu> writes:
On 11/28/2014 01:12 AM, Andrei Alexandrescu wrote:
 On 11/27/14 3:32 AM, Martin Nowak wrote:
 Actually not too bad :).

 https://dlang.dawg.eu/coverage/
 https://coveralls.io/r/MartinNowak/dmd
Wow, coveralls.io looks pretty nice! -- Andrei
And there is actually D support to upload dmd coverage reports. http://code.dlang.org/packages/doveralls
Nov 27 2014
prev sibling next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
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
The backend coverage is poor because I relied on the DMC test suite to deal with that. 70% is better than I expected. 90% for the front end isn't good enough. I'd like to be at 98% or so. Thanks for doing this, and the online reports look very nice!
Nov 27 2014
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
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
https://issues.dlang.org/show_bug.cgi?id=13786
Nov 27 2014
parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Thu, Nov 27, 2014 at 04:28:45PM -0800, Walter Bright via Digitalmars-d wrote:
 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
https://issues.dlang.org/show_bug.cgi?id=13786
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. T -- Prosperity breeds contempt, and poverty breeds consent. -- Suck.com
Nov 27 2014
next sibling parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"H. S. Teoh via Digitalmars-d"  wrote in message 
news:mailman.2389.1417136212.9932.digitalmars-d puremagic.com...

 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.
What I do is put a print/assert in the compiler functions you're looking for and then run it on the test case.
Nov 27 2014
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
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.
Nov 27 2014
next sibling parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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?? T -- Give me some fresh salted fish, please.
Nov 28 2014
prev sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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? T -- If creativity is stifled by rigid discipline, then it is not true creativity.
Nov 28 2014
parent reply Walter Bright <newshound2 digitalmars.com> writes:
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.
Nov 28 2014
next sibling parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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)
Nov 28 2014
prev sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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!
Nov 28 2014
parent Walter Bright <newshound2 digitalmars.com> writes:
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!
Nov 28 2014
prev sibling next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
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
Nov 28 2014
parent "Daniel Murphy" <yebbliesnospam gmail.com> writes:
"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.
Nov 28 2014
prev sibling next sibling parent reply "Trass3r" <un known.com> writes:
Plenty of "not covered" lines are actually assert(0)'s.
Nov 29 2014
parent Walter Bright <newshound2 digitalmars.com> writes:
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.
Nov 29 2014
prev sibling next sibling parent "Vic" <vic.cvc gmx.com> writes:
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.
Nov 29 2014
prev sibling parent Walter Bright <newshound2 digitalmars.com> writes:
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
Dec 05 2014