Re: dmd test coverage
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
Re: dmd test coverage
Plenty of not covered lines are actually assert(0)'s.
Re: dmd test coverage
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.
Re: dmd test coverage
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.
Re: dmd test coverage
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.
Re: dmd test coverage
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.
Re: dmd test coverage
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.
Re: dmd test coverage
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)
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!
Re: dmd test coverage
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
Re: dmd test coverage
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!
Re: dmd test coverage
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.
dmd test coverage
Actually not too bad :). https://dlang.dawg.eu/coverage/ https://coveralls.io/r/MartinNowak/dmd
Re: dmd test coverage
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
Re: dmd test coverage
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!
Re: dmd test coverage
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
Re: dmd test coverage
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
Re: dmd test coverage
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
Re: dmd test coverage
H. S. Teoh via Digitalmars-d wrote in message news:mailman.2389.1417136212.9932.digitalmar...@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.
Re: dmd test coverage
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.