Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Updates on Code Coverage in the Sdk itself (work-in-progress)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gregg Lind  
View profile  
 More options Nov 6 2012, 2:12 pm
From: Gregg Lind <gregg.l...@gmail.com>
Date: Tue, 6 Nov 2012 11:12:50 -0800 (PST)
Local: Tues, Nov 6 2012 2:12 pm
Subject: Updates on Code Coverage in the Sdk itself (work-in-progress)

(0.  If you want to do code-coverage in an addon, AND are willing to live
with these restrictions:

a.  no 'each' or other E4X extensions
b.  no conditional 'let'
c.  no conditional 'catch'

here is a method:  
https://github.com/gregglind/lotsa_addons/tree/master/testy)

Below are some partial notes on my attempts to instrument the sdk itself.  
I have tried two methods:

    cfx test --pkg-dir=fakey  #  complains about duplicate module errors

As an alternative, I tried to make a complete copy of the `addon-sdk`.  
There is some subset of modules that needs to be uninstrumented, so the
whole system can load, but I am not sure of what those are!

   ->  Bootstrap error: cannot find the global scope in
for:,addon-sdk/lib/sdk/system/events.js

```
    # let's instrument the sdk itself!

    ## gross to use a for-loop, but couldn't get this working in xargs
    # http://www.dwheeler.com/essays/filenames-in-shell.html

    cd directory/above/addon-sdk
    npm install git://github.com/gregglind/CoverJS.git#moz  # installs
moz-aware dependencies [1]

    rm -rf addon-sdk-test && cp -r addon-sdk addon-sdk-test &&
    ((cd addon-sdk && find lib -name '*js' -print0 && cd ..) | while IFS=""
read -r -d "" file ; do
       ./node_modules/coverjs-moz/bin/coverjs -o addon-sdk-test/`dirname
"$file"` --escodegen-options
'{"moz":{"starlessGenerator":true,"parenthesizedComprehensionBlock":true}}'
addon-sdk/"$file";
    done ) &> addon-sdk-test/instrument.log
    cd addon-sdk-test

    # this list is incomplete
    yes | cp {../addon-sdk/,}lib/sdk/deprecated/memory.js
    yes | cp {../addon-sdk/,}lib/sdk/loader/cuddlefish.js
    yes | cp {../addon-sdk/,}lib/toolkit/loader.js
    yes | cp {../addon-sdk/,}lib/sdk/test/harness.js
    yes | cp {../addon-sdk/,}lib/sdk/addon/runner.js
    yes | cp {../addon-sdk/,}lib/sdk/system/events.js
    yes | cp {../addon-sdk/,}lib/sdk/util/object.js

    ( ./bin/cfx test  ) 2>&1 | less
```


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »