Skip to content

Instantly share code, notes, and snippets.

@neonux
Created September 14, 2011 16:46
Show Gist options
  • Save neonux/1217064 to your computer and use it in GitHub Desktop.
Save neonux/1217064 to your computer and use it in GitHub Desktop.
function coverage(aDump)
{
return [];
}
function aggregate(aOriginalStats, aNewStats, aUpdate)
{
// aUpdate(aScript, aLine) is called for every line that changed since aOriginalStats
}
@neonux
Copy link
Author

neonux commented Sep 14, 2011 via email

@neonux
Copy link
Author

neonux commented Sep 14, 2011 via email

@davidflanagan
Copy link

load("Coverage.js")

var coverage = new Coverage();
coverage.addListener({
    onNewScript: function(filename, filedata) {
        print("New file: " + filename);
        print(JSON.stringify(filedata));
    },
    onScriptUpdate: function(filename, filedata) {
        print("File updated: " + filename);
        print("covered: " + filedata.covered);
        print("partial: " + filedata.partial);
        print("uncovered: " + filedata.uncovered);
        print("dead: " + filedata.dead);
    },
    onLineUpdate: function(filename, linedata) {
        print("Line updated: " + filename + ":" + linedata.linenum);
        print(linedata.counts);
    }
});

coverage.parseData(snarf("test.dis1"));
coverage.parseData(snarf("test.dis2"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment