Brutha has asked for the wisdom of the Perl Monks concerning the following question:

After reading the interesting Testaholics thread I downloaded Devel::Cover and tried to make it on my Windows 2000 with ActiveState Perl 5.6.1. It failed.

Well, I should have expect that, if I had read the test reports on CPAN. Did anybody managed to get this running?

I tried to fix it ...

As I investigated, it is after all because of the absence of the gettimeofday() function for the C-part.

After some search I found the _ftime() function, which gives the same functionality. So I wrote a wrapper-function GetTimeOfDay() which called _ftime(), defined HAS_GETTIMEOFDAY and run nmake. This step worked now.

Now I run nmake test, which failed for every test! So I tried nmake testdb TEST_FILE=t\aalias.t to see what is happening and found this working. What does that mean?

I am not sure wether it makes sense to go any further, as my time is limited. But if anybody has a hint or did try the same thing...

I did not post any code, it was just a quick hack, nothing to be proud of. If I am able to create a working patch, of course the author gets a note.

And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)

Replies are listed 'Best First'.
Re: Devel::Cover on Windows?
by rob_au (Abbot) on Apr 06, 2004 at 12:17 UTC
      Sorry, if I was unclear.

      As I sit behind a firewall, I have no access to PPM packages. So I made most modules by myself, including DBD::DB2, Tk and others. So, I consider myself being able to compile XS extensions. The perl Makefile.PL tells me about the dependent modules, if they are not installed.

      The main problem is, that it does not seem to be as easy as to exchange the call to gettimeofday() with something functional equivalent, like _ftime(). My try did not change the external behaviour of Devel::Cover::get_elapsed(), that was easy to do without knowledge of Devel::Cover internals. But afterwards all tests failed, but only if not run through the debugger. The README says, there is debugger support, so that should not be the problem.

      And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
      (Terry Pratchett, Small Gods)

Re: Devel::Cover on Windows?
by JSchmitz (Canon) on Apr 06, 2004 at 13:59 UTC
    Are you talking about Devel-Coverage? I just installed it no problem on Win2K using the package manager...


    PPM> install Devel-Coverage
    Install package 'Devel-Coverage?' (y/N): y
    Installing package 'Devel-Coverage'...
    Downloading
    http://ppm.ActiveState.com/PPMPackages/5.6plus/MSWin32-x86-multi-thr ead/Devel-Coverage.tar.gz ...
    Installing C:\Perl\html\site\lib\Devel\Coverage.html
    Installing C:\Perl\site\lib\Devel\Coverage.pm
    Installing C:\Perl\site\lib\Devel\Coverage\Analysis.pm
    Installing C:\Perl\site\lib\Devel\Coverage\prefs.pm
    Installing C:\Perl\site\lib\Devel\Coverage\Utils.pm
    Installing C:\Perl\bin\coverperl
    Installing C:\Perl\bin\coverperl.bat

    If you are using Active State Perl you are gonna wanna use the PPM package manager. Go to the bin directory where perl is installed and type: PPM this will put you at the ppm> prompt where you can use help to see all the options or you could just do an install Devel::Cover

    drink long and prosper

    Jeffery
      Note that Devel::Coverage is a different (older) module which is somewhat less mature in it's development cycle than that of Devel::Cover.

       

      perl -le "print unpack'N', pack'B32', '00000000000000000000001011001101'"

Re: Devel::Cover on Windows?
by PodMaster (Abbot) on Apr 06, 2004 at 17:30 UTC
    For the time being just use the last known good version which is 0.34. Heard of RT? If you're itchy you may with to work it out as per unresolved external symbol _get_elapsed win32.c.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Thanks PodMaster,

      I found the CPAN Testers report, but must have missed version 0.34, which reports Win32 passed. So I downloaded that version and tried it.

      It Makes/Compiles ok, but tests are very suspicious. The effect is:
      - nmake test fails 100%
      - nmake testdb TEST_FILE=t/aalias.t gives 'ok 1'
      (define __COVER__DEBUG for debug output)

      Then I had a deeper look at version 0.40, fixed the unresolved externals and get the same effect.

      RT is Request Tracker, which I had heard of and which I now have seen ;-) Thank You for this second hint.
      As it states, the author seems to work on the first part. So I decided to contact him and offered my results. This should avoid double work.

      Thank You all again for your hints.

      And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
      (Terry Pratchett, Small Gods)

Re: Devel::Cover on Windows?
by eyepopslikeamosquito (Archbishop) on Apr 07, 2004 at 09:44 UTC

    Notice Devel::Cover will likely soon require perl 5.8 or above as discussed here.

    I just successfully installed Devel-Cover-0.40 on Windows XP with perl 5.8.3 as shown below. Sorry, I don't have time to investigate further right now, but a quick search for gettimeofday in perl 5.8 sources brought some hits in Time::HiRes (which is a standard module in 5.8) and in other places also.

    # make cp lib/Devel/Cover/DB/File.pm blib\lib\Devel\Cover\DB\File.pm cp lib/Devel/Cover/Statement.pm blib\lib\Devel\Cover\Statement.pm cp lib/Devel/Cover/Subroutine.pm blib\lib\Devel\Cover\Subroutine.pm cp lib/Devel/Cover/DB/Structure.pm blib\lib\Devel\Cover\DB\Structure.p +m cp lib/Devel/Cover/Condition_xor_4.pm blib\lib\Devel\Cover\Condition_x +or_4.pm cp lib/Devel/Cover/Branch.pm blib\lib\Devel\Cover\Branch.pm cp lib/Devel/Cover/Condition_or_2.pm blib\lib\Devel\Cover\Condition_or +_2.pm cp lib/Devel/Cover/Inc.pm blib\lib\Devel\Cover\Inc.pm cp lib/Devel/Cover/Report/Html.pm blib\lib\Devel\Cover\Report\Html.pm cp lib/Devel/Cover/Op.pm blib\lib\Devel\Cover\Op.pm cp lib/Devel/Cover/Condition_and_3.pm blib\lib\Devel\Cover\Condition_a +nd_3.pm cp lib/Devel/Cover.pm blib\lib\Devel\Cover.pm cp lib/Devel/Cover/Report/Html_basic.pm blib\lib\Devel\Cover\Report\Ht +ml_basic.pm cp lib/Devel/Cover/Report/Text.pm blib\lib\Devel\Cover\Report\Text.pm cp lib/Devel/Cover/Report/Text2.pm blib\lib\Devel\Cover\Report\Text2.p +m cp lib/Devel/Cover/Pod.pm blib\lib\Devel\Cover\Pod.pm cp lib/Devel/Cover/Report/Html_minimal.pm blib\lib\Devel\Cover\Report\ +Html_minimal.pm cp lib/Devel/Cover/DB.pm blib\lib\Devel\Cover\DB.pm cp lib/Devel/Cover/Truth_Table.pm blib\lib\Devel\Cover\Truth_Table.pm cp lib/Devel/Cover/Tutorial.pod blib\lib\Devel\Cover\Tutorial.pod cp lib/Devel/Cover/Time.pm blib\lib\Devel\Cover\Time.pm cp lib/Devel/Cover/Condition_or_3.pm blib\lib\Devel\Cover\Condition_or +_3.pm cp lib/Devel/Cover/Criterion.pm blib\lib\Devel\Cover\Criterion.pm cp lib/Devel/Cover/Report/Html_subtle.pm blib\lib\Devel\Cover\Report\H +tml_subtle.pm cp lib/Devel/Cover/Test.pm blib\lib\Devel\Cover\Test.pm cp lib/Devel/Cover/Condition.pm blib\lib\Devel\Cover\Condition.pm D:\Perl58\bin\perl.exe D:\Perl58\lib\ExtUtils/xsubpp -typemap D:\ +Perl58\lib\ExtUtils\typemap -typemap typemap Cover.xs > Cover.xsc && + D:\Perl58\bin\perl.exe -MExtUtils::Command -e mv Cover.xsc Cover.c cl -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE - +DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPERL_IMPLICIT_CONTEXT - +DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBU +G -O1 -DVERSION=\"0.40\" -DXS_VERSION=\"0.40\" "-ID:\Perl58\lib\ +CORE" Cover.c Cover.c Cover.c(967) : warning C4101: 'RETVAL' : unreferenced local variable Running Mkbootstrap for Devel::Cover () D:\Perl58\bin\perl.exe -MExtUtils::Command -e chmod 644 Cover.bs D:\Perl58\bin\perl.exe -MExtUtils::Mksymlists -e "Mksymlists('NAM +E'=>\"Devel::Cover\", 'DLBASE' => 'Cover', 'DL_FUNCS' => { }, 'FUNCL +IST' => [], 'IMPORTS' => { }, 'DL_VARS' => []);" link -out:blib\arch\auto\Devel\Cover\Cover.dll -dll -nologo -nodef +aultlib -debug -opt:ref,icf -libpath:"D:\Perl58\lib\CORE" -machine: +x86 Cover.obj D:\Perl58\lib\CORE\perl58.lib oldnames.lib kernel32.l +ib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell +32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr. +lib winmm.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib -def:Co +ver.def Creating library blib\arch\auto\Devel\Cover\Cover.lib and object bl +ib\arch\auto\Devel\Cover\Cover.exp D:\Perl58\bin\perl.exe -MExtUtils::Command -e chmod 755 blib\arch\ +auto\Devel\Cover\Cover.dll D:\Perl58\bin\perl.exe -MExtUtils::Command -e cp Cover.bs blib\arc +h\auto\Devel\Cover\Cover.bs D:\Perl58\bin\perl.exe -MExtUtils::Command -e chmod 644 blib\arch\ +auto\Devel\Cover\Cover.bs D:\Perl58\bin\perl.exe -MExtUtils::Command -e cp cover blib\script +\cover pl2bat.bat blib\script\cover D:\Perl58\bin\perl.exe -MExtUtils::Command -e cp gcov2perl blib\sc +ript\gcov2perl pl2bat.bat blib\script\gcov2perl # make test D:\Perl58\bin\perl.exe -MExtUtils::Command -e cp cover blib\script +\cover pl2bat.bat blib\script\cover D:\Perl58\bin\perl.exe -MExtUtils::Command -e cp gcov2perl blib\sc +ript\gcov2perl pl2bat.bat blib\script\gcov2perl D:\Perl58\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harnes +s(0, 'blib\lib', 'blib\arch')" t\aalias.t t\aalias1.t t\abranch_retur +n_sub.t t\acond_and.t t\acond_branch.t t\acond_or.t t\acond_xor.t t\a +default_param.t t\adestroy.t t\adynamic_subs.t t\aeval1.t t\afork.t t +\aif.t t\amodule1.t t\amodule2.t t\amodule_import.t t\aoverloaded.t t +\apod.t t\askip.t t\aspecial_blocks.t t\astatement.t t\at0.t t\at1.t +t\at2.t t\atrivial.t t\md5.t t\aalias................ok t\aalias1...............ok t\abranch_return_sub....ok t\acond_and.............ok t\acond_branch..........ok t\acond_or..............ok t\acond_xor.............ok t\adefault_param........ok t\adestroy..............ok t\adynamic_subs.........ok t\aeval1................ok t\afork.................ok 1/1 skipped: Fork unreliable t\aif...................ok t\amodule1..............ok t\amodule2..............ok t\amodule_import........ok t\aoverloaded...........ok t\apod..................ok t\askip.................ok t\aspecial_blocks.......ok t\astatement............ok t\at0...................ok t\at1...................ok t\at2...................ok t\atrivial..............ok t\md5...................ok All tests successful, 1 subtest skipped. Files=26, Tests=26, 294 wallclock secs ( 0.00 cusr + 0.00 csys = 0.0 +0 CPU)