Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1788 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Code coverage issue

Reported by: SHOO Assigned to: kris
Priority: major Milestone: 0.99.9
Component: Tango Version: trunk
Keywords: Cc:

Description

Now, code coverage dose not completely work with this case:

module a.xxx;
int func() {return 0;}
module b.xxx;
int func() {return 0;}
module main;
version (D_Coverage) import tango.io.Path;
import tango.io.Stdout;
import a.xxx;
import b.xxx;
void main()
{
	Stdout(a.xxx.func + b.xxx.func).newline;
}

version (D_Coverage) extern (C) void dmd_coverDestPath(char[]); 
static this()
{
	version (D_Coverage)
	{
		if (!tango.io.Path.exists(r"cov")) tango.io.Path.createFolder(r"cov");
		dmd_coverDestPath(r"cov");
	}
}

I think that bad code is:

//#138
            if( !readFile( addExt( baseName( c.filename ), "lst" ), lstbuf ) )

//#167
        FILE* flst = fopen( (addExt( baseName( c.filename ), "lst\0" )).ptr, "wb" );

Can you fix this?

Attachments

cover.patch (1.0 kB) - added by SHOO on 11/18/09 17:21:28.

Change History

11/18/09 17:21:28 changed by SHOO

  • attachment cover.patch added.

11/18/09 18:14:26 changed by larsivi

  • owner changed from sean to fawzi.

11/29/09 12:17:32 changed by fawzi

  • owner changed from fawzi to kris.

01/12/10 03:57:15 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.

(In [5284]) fixes #1788 :: Code coverage issue

Thanks to SHOO