Export to GitHub

flexcover - issue #4

Doesn't seem to be a way to get the coverage report from the oem compiler


Posted on Apr 26, 2008 by Grumpy Dog

What steps will reproduce the problem? 1. Try to instrument an application with the oem compiler 2. can't find a way to set the coverage report file name

What is the expected output? What do you see instead? I'm hoping to see a .cvm file, but I don't get one and see no way to set one

What version of the product are you using? On what operating system? 0.11

Please provide any additional information below.

The sdk patchfile shows: You can use the <code>Report.writeCoverageMetadata()</code> method to retrieve the linker report.

However, this method does not appear to be implemented

There is also a getCoverageMetadataFileName() method, but I don't see a way to set the value using the oem compiler Configuration class.

Comment #1

Posted on Apr 26, 2008 by Helpful Horse

The OEM integration was not tested for the experimental release -- I am sure there are problems.

In the next release, the .cvm file will be produced automatically whenever coverage is requested.

Comment #2

Posted on Apr 26, 2008 by Helpful Horse

Please attach a code snippet that indicates how you are invoking the compiler.

Comment #3

Posted on Apr 26, 2008 by Grumpy Dog

I have attached a patch that I think will work. I cannot get a good build to test it with though.

Here is a test project I was using to try and test it with:

import flex2.tools.oem.Application; import flex2.tools.oem.Configuration; import flex2.tools.oem.Report; import flex2.tools.oem.internal.OEMConfiguration;

import java.io.*; import java.util.Arrays; public class MyConfiguringCompiler { public static void main(String[] args) { String outputRoot = "src"; try { Application application = new Application(new File(outputRoot, "TestApp.mxml")); application.setOutput(new File(outputRoot, "TestApp.swf"));

        Configuration config = application.getDefaultConfiguration(); 
        // Enable ActionScript optimizer. 
        config.optimize(true); 
        // Disable warnings.            
        config.showActionScriptWarnings(false); 
        config.showBindingWarnings(false); 
        config.showUnusedTypeSelectorWarnings(false); 
        config.keepCoverageMetadata(true);
        config.enableCoverage(true);

        config.keepLinkReport(true);
        config.keepConfigurationReport(true);

        // Apply the new configuration to the Application. 
        application.setConfiguration(config);

        System.out.println(
                "Flex compiler configurations:"
                        + config.toString().replace("--", "\n--"));

        long result = application.build(true); 
        StringWriter stringWriter = new StringWriter();
        application.getReport().writeLinkReport(stringWriter);
        System.out.println(stringWriter.toString());
        stringWriter = new StringWriter();
        application.getReport().writeConfigurationReport(stringWriter);
        System.out.println(stringWriter.toString());
        if (result > 0) { 
            System.out.println("COMPILE OK");            
        } else { 
            System.out.println("COMPILE FAILED"); 
        } 
    } catch (Exception ex) { 
        ex.printStackTrace(); 
    } 
} 

}

Attachments

Comment #4

Posted on Apr 28, 2008 by Helpful Horse

(No comment was entered for this change.)

Comment #5

Posted on May 13, 2008 by Helpful Horse

This bug is now fixed on the trunk and will be released in the next rev of flexcover.

Status: Fixed

Labels:
Type-Defect Priority-Medium