views:

168

answers:

2

Hi all:

I'm using genhtml (in Windows under cygwin) to generate a unit test coverage report from 2 coverage data files. They are all coverage data from the same unit test source file.

However, when I entered the following command:

perl genhtml /home/administrator/coverage1.dat /home/administrator/coverage2.dat

I got the following output and problem:

Reading data file /home/administrator/coverage1.dat
Reading data file /home/administrator/coverage2.dat
genhtml: Can't use an undefined value as a HASH reference at genhtml line 1506.

And it failed to generate anything.

I played around with the files, and discovered that one reason might be because of the repeating headers and files in the coverage data.

Is this a known issue, or does anyone know a way to get around it, or am I on the wrong track?

Thanks.

+1  A: 

The message is a fatal error caused by trying to dereference an undefined value as if it were a hash reference.

There is either a bug in genhtml or your data files are corrupt.

Have you tried asking on the lcov mailing list?

daotoad
I changing both files from ANSI to UTF-8 encoding, and the command worked EXCEPT the first record didnt get counted. I then tried to see whether it is other js files/file formats that caused troubles. But no obvious pattern there. Not sure whether that sounded like a bug or corrupted file?
BeraCim
@BeraCim, I don't use lcov, and I certainly don't hack on it. So, I can't give you any more specific advice. The mailing list is the best place to get help from people with the specific knowledge needed to help you figure this out. See http://ltp.sourceforge.net/coverage/lcov.php and https://lists.sourceforge.net/lists/listinfo/ltp-coverage
daotoad
Scrap what I've just said... it was a fluke. The file format has nothing to do with the result. However the first instance in the coverage data did not get run at all. Also, I confirmed that any repeating groups found in the coverage data file will cause the above error. I have posted in the lcov mailing list. Hope I'll get an answer soon. Will keep this thread posted.
BeraCim
A: 

I have downloaded the latest lcov and genhtml from sourceforge. It fixed the problem.

Thanks.

BeraCim