Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCL Code Coverage

420 views
Skip to first unread message

ashish...@gmail.com

unread,
Nov 3, 2006, 6:43:42 PM11/3/06
to
I am developing a TCL application. I want to test it thoroughly with
multiple testcase. To ensure that I have almost full code average, I
need some application which can take these inputs ( source file,
multiple test files) and outputs lines which are not covered by any of
these test files.

Thanks in advance.

Ashish

Jeff Hobbs

unread,
Nov 3, 2006, 10:36:04 PM11/3/06
to ashish...@gmail.com

The Tcl Dev Kit provides code coverage functionality:
http://www.activestate.com/Tcl

--

Jeff Hobbs, The Tcl Guy, http://www.activestate.com/

john_...@mentor.com

unread,
Dec 11, 2006, 6:35:44 PM12/11/06
to

Jeff,

I am trying to use the code coverage functionality in the Tcl Dev Kit
debugger, but I
can not seem to get it to work. My application is a mixed bag of C/Tcl
code (we use a
lot of incrTcl) and I am using Remote Debugging. I have turned on Code
Coverage in
the project settings, but when I bring up the Code Coverage Dialog, it
does not contain
any data. Nothing is shown under Files or Calls. I do notice that my
main tcl file shown
in the source window is now shown in Green (default color for uncalled
code). I do know
that this code was executed when I clicked on the run arrow.

I can set breakpoints and look at the contents of variables, but I
right now I am stumped on
the code coverage tool. This is Tcl Dev Kit 3.2.

Did I miss turning on a checkbox or something? Or does this beast not
work with remote
debugging and/or mixed C/Tcl code?

Thanks,

John Hughes

Larry W. Virden

unread,
Dec 12, 2006, 8:12:31 AM12/12/06
to

Jeff Hobbs wrote:
> The Tcl Dev Kit provides code coverage functionality:
> http://www.activestate.com/Tcl


Has anyone used this functionality to see how well the Tcl test suite
(and the Tk test suite) covers the tcl (and tk) code?

Jeff Hobbs

unread,
Dec 12, 2006, 11:27:01 AM12/12/06
to john_...@mentor.com
john_...@mentor.com wrote:
> Jeff Hobbs wrote:
>> ashish...@gmail.com wrote:
>>> I am developing a TCL application. I want to test it thoroughly with
>>> multiple testcase. To ensure that I have almost full code average, I
>>> need some application which can take these inputs ( source file,
>>> multiple test files) and outputs lines which are not covered by any of
>>> these test files.
>> The Tcl Dev Kit provides code coverage functionality:
>> http://www.activestate.com/Tcl
>>
>
> Jeff,
>
> I am trying to use the code coverage functionality in the Tcl Dev Kit
> debugger, but I
> can not seem to get it to work. My application is a mixed bag of C/Tcl
> code (we use a
...

Let me know if this wasn't solved in the support channel.

Jeff Hobbs

unread,
Dec 12, 2006, 11:28:15 AM12/12/06
to Larry W. Virden

I haven't gone through the core test suite, since that tests 99% C and
just a bit of Tcl (OK, obviously an important bit), but we have run it
over large parts of tcllib.

Larry W. Virden

unread,
Dec 12, 2006, 11:49:16 AM12/12/06
to

Jeff Hobbs wrote:
> Larry W. Virden wrote:
> > Jeff Hobbs wrote:
> >> The Tcl Dev Kit provides code coverage functionality:
> >> http://www.activestate.com/Tcl
> >
> >
> > Has anyone used this functionality to see how well the Tcl test suite
> > (and the Tk test suite) covers the tcl (and tk) code?
>
> I haven't gone through the core test suite, since that tests 99% C and
> just a bit of Tcl (OK, obviously an important bit), but we have run it
> over large parts of tcllib.

Have any tools available to perform coverage of the C parts of Tcl and
Tk been used?
Just curious how much of the code is currently tested.

john_...@mentor.com

unread,
Dec 12, 2006, 1:45:07 PM12/12/06
to


I figured out my problem. It was pilot error on my part. I seemed to
forget how
my product works and was not debugging (code coverage) in a realistic
manner.
I tightened the loose nut behind the keyboard and it works now! ;-p

John

Jeff Hobbs

unread,
Dec 12, 2006, 10:31:56 PM12/12/06
to Larry W. Virden

Something like PureCov? Not that I know of. Occasional Purify and
valgrind runs are made over the core, and there are the Coverity reports
for which we fix issues as they are reported.

Larry W. Virden

unread,
Dec 13, 2006, 9:26:41 AM12/13/06
to

Jeff Hobbs wrote:
> Something like PureCov? Not that I know of. Occasional Purify and
> valgrind runs are made over the core, and there are the Coverity reports
> for which we fix issues as they are reported.

Sigh. I tried, this morning, to set up the Tcl Makefile to use the Sun
C compiler coverage tool. Alas, when I got to the point of creating
libtcl.so, it failed, because it uses ld directly instead of cc, and cc
supposedly adds some coverage libraries or something that are necessary
- I got a long string of linker error msgs . Oh well, I just thought if
I could spend 20 minutes making the changes and running the tcl 8.5
test suite to get a coverage report, it might be useful.

0 new messages