Menu

ANT CTL command

2011-05-03
2013-05-09
  • Kishore Kumar

    Kishore Kumar - 2011-05-03

    Does any one know how to integrate EMMA CTL command to ANT such that to generate and extract coverage data without actually shutdown the server ?  If yes please help me out..

     
  • Onkar Shinde

    Onkar Shinde - 2011-06-24

    Here is how we use in our project. The important properties (read from some properties file) are as follows.
    jvm.host.port=localhost:47653
    coverage.dir (a directory where .em files from instrumentation and .ec file containing coverage data)
    coverage.file (name of .ec file)
    project.source.path (semicolon or colon separated path for all source folders)
    coverage.report.file (name of html report file)

        <path id="emma.lib">
            <pathelement location="${emma.dir}/emma.jar" />
            <pathelement location="${emma.dir}/emma_ant.jar" />
        </path>
        <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
        <target name="coverage-report">
            <emma>
                <ctl connect="${jvm.host.port}">
                    <command name="coverage.get" args="${coverage.dir}/${coverage.file},true" />
                    <command name="coverage.reset" />
                </ctl>
                <report sourcepath="${project.source.path}" metrics="block:70,line:70">
                    <fileset dir="${coverage.dir}">
                        <include name="*.em" />
                        <include name="${coverage.file}" />
                    </fileset>
                    <html outfile="${coverage.dir}/${coverage.report.file}" />
                </report>
            </emma>
        </target>
    
     

Log in to post a comment.