Coverage!!!

Discussion in 'Ruby' started by Koustubh Joshi, May 23, 2007.

  1. Hi,

    Am trying to run my ruby files in rcov task,

    here is the code, am using,

    begin
    require 'rcov/rcovtask'

    Rcov::RcovTask.new do |t|

    t.test_files = FileList["/**/TestCase/*.rb"]
    t.verbose = true
    end
    rescue LoadError
    puts 'Rcov is not available.'
    end

    There are many .rb files in that TestCase folder but it is showing the
    coverage of only one file...

    Will you plz help me, how i can get covrage of all .rb files.

    --
    Posted via http://www.ruby-forum.com/.
    Koustubh Joshi, May 23, 2007
    #1
    1. Advertising

  2. Koustubh Joshi

    Jano Svitok Guest

    On 5/23/07, Koustubh Joshi <> wrote:
    > Hi,
    >
    > Am trying to run my ruby files in rcov task,
    >
    > here is the code, am using,
    >
    > begin
    > require 'rcov/rcovtask'
    >
    > Rcov::RcovTask.new do |t|
    >
    > t.test_files = FileList["/**/TestCase/*.rb"]
    > t.verbose = true
    > end
    > rescue LoadError
    > puts 'Rcov is not available.'
    > end
    >
    > There are many .rb files in that TestCase folder but it is showing the
    > coverage of only one file...
    >
    > Will you plz help me, how i can get covrage of all .rb files.


    Please, before reposting the same question, first see the answers you
    have already got [1] and comment on them.

    J.

    [1] http://www.ruby-forum.com/topic/108893#248556
    Jano Svitok, May 23, 2007
    #2
    1. Advertising

  3. Jano Svitok wrote:
    > On 5/23/07, Koustubh Joshi <> wrote:
    >>
    >> Will you plz help me, how i can get covrage of all .rb files.

    > Please, before reposting the same question, first see the answers you
    > have already got [1] and comment on them.
    >
    > J.
    >
    > [1] http://www.ruby-forum.com/topic/108893#248556



    I tried the options that u have specified, but it showing coverage for
    only one test script that is last one...

    Could u plz help me solve it....

    thankx...

    --
    Posted via http://www.ruby-forum.com/.
    Koustubh Joshi, May 23, 2007
    #3
  4. Koustubh Joshi

    Jano Svitok Guest

    On 5/23/07, Koustubh Joshi <> wrote:
    > Jano Svitok wrote:
    > > On 5/23/07, Koustubh Joshi <> wrote:
    > >>
    > >> Will you plz help me, how i can get covrage of all .rb files.

    > > Please, before reposting the same question, first see the answers you
    > > have already got [1] and comment on them.
    > >
    > > J.
    > >
    > > [1] http://www.ruby-forum.com/topic/108893#248556

    >
    >
    > I tried the options that u have specified, but it showing coverage for
    > only one test script that is last one...
    >
    > Could u plz help me solve it....


    Ok,

    1. do your test scripts have name tc_something.rb or test_something.rb?
    if yes, they do not appear in rcov by design. Try plaing with
    --include-file or --exclude-only parameters to rcov

    2. Check your FileList by adding
    puts t.test_files just after the assignment

    This is how my RCovTask looks like (I'm using fixed array of test
    files, as I don't want to run each of them. Now I don't remember any
    more why I have put --aggregate there.

    Rcov::RcovTask.new do |t|
    t.test_files = FileList[*SHORT_TESTS]
    t.output_dir = RCOV_OUTPUT

    t.rcov_opts = [
    "--sort coverage",
    "--sort-reverse",
    "--include-file /\btc_[^.]*\.rb/",
    "--aggregate #{RCOV_DATABASE}"
    ]
    end

    J.
    Jano Svitok, May 23, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samuel

    Cross-product coverage

    Samuel, Apr 3, 2004, in forum: VHDL
    Replies:
    2
    Views:
    668
    Srinivasan Venkataramanan
    Apr 5, 2004
  2. Tony Smith
    Replies:
    0
    Views:
    781
    Tony Smith
    Apr 28, 2004
  3. Raj
    Replies:
    4
    Views:
    7,762
    asicvlsi
    Feb 21, 2008
  4. Ben Finney
    Replies:
    7
    Views:
    521
    Ned Batchelder
    Oct 30, 2007
  5. Replies:
    0
    Views:
    372
Loading...

Share This Page