www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - Add coverage highlighting to IDE

reply Walter Bright <newshound2 digitalmars.com> writes:
Just an idea for an IDE.

At the push of a button, run the unittests with -cov on the module being 
editted, read the coverage listing file, and then highlight the code lines that 
were never executed.
Mar 23 2013
next sibling parent reply "alex" <info alexanderbothe.com> writes:
On Saturday, 23 March 2013 at 23:14:59 UTC, Walter Bright wrote:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the 
 module being editted, read the coverage listing file, and then 
 highlight the code lines that were never executed.

How to run only one module('s unittests)? With rdmd? Or just via dmd with a specific flag set?
Mar 27 2013
parent Walter Bright <newshound2 digitalmars.com> writes:
On 3/27/2013 3:10 PM, nazriel wrote:
 On Wednesday, 27 March 2013 at 12:08:00 UTC, alex wrote:
 On Saturday, 23 March 2013 at 23:14:59 UTC, Walter Bright wrote:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the module being
 editted, read the coverage listing file, and then highlight the code lines
 that were never executed.

How to run only one module('s unittests)? With rdmd? Or just via dmd with a specific flag set?

I think Walter (?) added a flag to dmd: -main add default main() (e.g. for unittesting) Maybe runnng dmd with this flag on 1 module and then running it could help?

Yup. That's just what -main is for!
Apr 04 2013
prev sibling next sibling parent "Johannes Pfau" <nospam example.com> writes:
On Wednesday, 27 March 2013 at 12:08:00 UTC, alex wrote:
 On Saturday, 23 March 2013 at 23:14:59 UTC, Walter Bright wrote:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the 
 module being editted, read the coverage listing file, and then 
 highlight the code lines that were never executed.

How to run only one module('s unittests)? With rdmd? Or just via dmd with a specific flag set?

With a custom unit test runner like this one: https://github.com/D-Programming-Language/druntime/blob/master/src/test_runner.d
Mar 27 2013
prev sibling next sibling parent "nazriel" <spam dzfl.pl> writes:
On Wednesday, 27 March 2013 at 12:08:00 UTC, alex wrote:
 On Saturday, 23 March 2013 at 23:14:59 UTC, Walter Bright wrote:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the 
 module being editted, read the coverage listing file, and then 
 highlight the code lines that were never executed.

How to run only one module('s unittests)? With rdmd? Or just via dmd with a specific flag set?

I think Walter (?) added a flag to dmd: -main add default main() (e.g. for unittesting) Maybe runnng dmd with this flag on 1 module and then running it could help?
Mar 27 2013
prev sibling next sibling parent "Flamaros" <flamaros.xavier gmail.com> writes:
On Wednesday, 27 March 2013 at 12:08:00 UTC, alex wrote:
 On Saturday, 23 March 2013 at 23:14:59 UTC, Walter Bright wrote:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the 
 module being editted, read the coverage listing file, and then 
 highlight the code lines that were never executed.

How to run only one module('s unittests)? With rdmd? Or just via dmd with a specific flag set?

I think you have to take a look at : http://dlang.org/code_coverage.html It seems you just have to call dmd with the module name and -cov option as parameter. I used eclemma plugin for coverage highlighting on Eclipse, and a usefull feature is the capability to use layered result which allow you to increase the cover by using many configurations. Unit tests with highlighting decrease a little the need of debuggers, because using asserts or conditions aren't harder to use break points. Maybe it will be necessary to add names on tests.
Mar 31 2013
prev sibling parent Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
24.03.2013 3:14, Walter Bright пишет:
 Just an idea for an IDE.

 At the push of a button, run the unittests with -cov on the module being
 editted, read the coverage listing file, and then highlight the code
 lines that were never executed.

As mentioned in [1] it is implemented in Visual D now. See Visual D's news [2]. [1] http://forum.dlang.org/thread/kml75b$1jm$1 digitalmars.com?page=2#post-ko7i81:24ng4:241:40digitalmars.com [2] http://www.dsource.org/projects/visuald/wiki/News36 -- Денис В. Шеломовский Denis V. Shelomovskij
Jun 07 2013