You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Run a Cloud9 test on prod-cons (the quickstart tutorial).
2. Use the attached coverage-tool to read the coverage.bin present in
test-prod-cons.
$ coverage-tool test-prod-cons/coverage.bin
There should be values for all six fields. However, covered source lines,
covered assembly lines, and both coverage percentages are all 0. After some
investigating, I discovered that Cloud9 writes the coverage.bin file *before*
the actual Cloud9 testing begins. Because of this, I edited the StatsTracker
class (StatsTracker.h and StatsTracker.cpp). My StatsTracker class is different
in the following ways:
1. writeDetailedCoverageSnapshot has a second boolean parameter:
actually_write. If actually_write is true, coverageInfo is updated and
coverage.bin is created. If actually_write is false, coverageInfo is still
updated but coverage.bin is not created.
2. In the destructor, writeDetailedCoverageSnapShot is called.
So essentially, this is how my edited code works:
1. On object creation (constructor), coverageInfo is updated but coverage.bin
is *not* written.
2. On object deallocation (destructor), coverageInfo is updated and
coverage.bin is written.
I am using the latest version of Cloud9 on Ubuntu 12.04 LTS.
coverage-tool is my own creation. Feel free to add it to the Cloud9 tools and
modify it all you like. It's yours now.
I've also attached my modified StatsTracker.cpp and StatsTracker.h.
Thanks,
Will O'Leary
Original issue reported on code.google.com by willis.c...@gmail.com on 29 Jul 2013 at 10:46
Will, I'm sorry you had to spend more time than necessary trying out things
here -- the Cloud9 documentation in this space is deficient.
The coverage.bin file actually contains multiple protobuf messages, each
message contained in a "message frame". A message frame starts with a 32-bit
integer describing the message size, followed by the message bytes themselves.
The first protobuf message lists all coverable lines in the program, so it
constitutes the 100% coverage. It is written once before the actual symbolic
exporation starts.
The following protobuf messages in the file are coverage snapshots at different
moments in time. If I remember correctly, by default they are written to the
coverage log every minute. Each message contains the lines covered by symbolic
execution up to that moment in time.
Original comment by stefan.b...@gmail.com on 30 Jul 2013 at 6:08
Original issue reported on code.google.com by
willis.c...@gmail.com
on 29 Jul 2013 at 10:46Attachments:
The text was updated successfully, but these errors were encountered: