1 Reply Latest reply on Oct 1, 2010 12:11 PM by legrosb

    FlexUnit4FlexCoverListener - How to use ?

    BrunoSelva

      Hi,

       

      I need a little help with FlexUnit4 and FlexCover.

       

      I download from trunk, and I saw and build the
      FlexUnit4FlexCoverListener.

       

      I not see any documentation about that yet. Could you help me with
      that?

       

      I trying to run a anttask to do that. Then i need to transform the
      FlexCover cvm in EMMA report.

       

      I saw an xsl transformation file, but I'm not be able to do that
      transformation.

       

      Any trick ?

       

      Thanks a lot,

      Bruno Selva

        • 1. Re: FlexUnit4FlexCoverListener - How to use ?
          legrosb

          @Bruno - The FlexCoverListener is an extension of the CIListener which will call CoverageManager.exit() from the FlexCover Agent API to close the CoverageViewer AIR app as well as the Flash Player.  FlexCover requires your test runner to be compiled with a special FlexCover variation of the Flex SDK; that will produce a SWF and a CVM file.  The CVM file is then loaded by the CoverageViewer AIR application which should be executed prior to launching the flexunit Ant task.  As the test runner SWF executes, it sends FlexCover data over the wire to the CoverageViewer application which when told to close, will produce a CVR file.  The CVR file is an XML file which, using XSLT 2.0, can have a transformation applied to it to create a Cobertura compliant report.  Transforming the CVM file will not produce a code coverage report.  I'd suggest reading up on the instructions which come with the FlexCover download for more details.

           

          As far as producing an Emma coverage report, there is a guy named Paul @ http://eyefodder.com/ who has done some special builds to produce EMMA integration with FlexCover that you might want to check out.  For FlexUnit 4.2 we're going to be adding code coverage support through Apparat, so hopefully that should reduce the need for involved integrations with libraries like FlexCover.  Additionally, Adobe has released a plugin for FlashBuilder recently that will show you coverage for source files when running tests in FlashBuilder (http://labs.adobe.com/technologies/ascode_coverage/).

           

          HTH.

           

          -Brian