Find the answer to your Linux question:
Results 1 to 2 of 2
Ok heretics, WindowsDude has another question for you ! I have this treacherous program in C which uses external static libraries (extern etc), and want to do a coverage test ...
  1. #1
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12

    Coverage testing with gcov

    Ok heretics, WindowsDude has another question for you !

    I have this treacherous program in C which uses external static libraries (extern etc), and want to do a coverage test of it. The libraries are written in fortran.

    I compile like this
    Code:
     gcc -fprofile-arcs -ftest-coverage -o main main.c  library.o
    I run my nice program like that

    Code:
    ./main
    Then I do the magic stuff

    Code:
    gcov main.c library.f

    Ok 98% of the lines were used in main.c, and I get a file with line counts and all that. Great! But, I need to know the coverage in my library too! It says 0.0% and that's impossible. So what can I do?

    I can't run it like an executable because it's a library.










    And why is the terminal not accepting my copy paste? I copy some lines from my IDE, then I want to paste it into the terminal (with ctrl-v of course, not some crazy local application non-standard counter-intuitive key combo made just to cause agony among honest users!), and that could've been the only problem here, but it isn't. I can't even paste with that right click menu. So, if I was crazy before, I went nuts after that. My great "solution" was to paste it into the firefox URL field (not the search field ) and then copy that and paste it into the terminal. Is that common practice for you all while dealing with that unburied DOS-window?

  2. #2
    Just Joined! WindowsDude's Avatar
    Join Date
    May 2010
    Location
    Wintopia
    Posts
    12
    Ok, so I tested this on another computer and it worked. Same reliability as on Windows 95!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...