【问题标题】:How do you get FlexUnit output in JUnit format?如何获得 JUnit 格式的 FlexUnit 输出?
【发布时间】:2011-03-12 05:26:12
【问题描述】:

我正在设置 FlexUnit to run from the command line 并希望以 JUnit 格式捕获结果,以便我可以将它们拉入 Hudson。

我有什么选择?

【问题讨论】:

  • 你使用 ANT 还是 Maven?
  • 其实我们用的是Make。我们构建了自己的构建系统来应对 FlexBuilder 中的限制。

标签: apache-flex junit continuous-integration hudson flexunit


【解决方案1】:

我使用 ANT 来生成我的 JUnit 风格的 FlexUnit 报告。我以前没有使用过 Make,所以我不能直接帮助你使用它的语法。但是,如果它有帮助,这对于我的项目的 ANT 构建文件来说是个难题:

<target name="test">
        <echo>Executing FlexUnit tests...</echo>

        <!-- Execute TestRunner.swf as FlexUnit tests and publish reports -->
        <flexunit 
            workingDir="${bin.loc}"
            toDir="${report.loc}" 
            haltonfailure="false" 
            verbose="true" 
            localTrusted="true">

            <source dir="${main.src.loc}" />

            <testSource dir="${test.src.loc}">
                <include name="**/*Test.as" />
            </testSource>

            <library dir="${lib.loc}"/>
       </flexunit>

        <echo>Testing Complete</echo>
        <echo>Generating test reports...</echo>

        <!-- Generate readable JUnit-style reports -->
        <junitreport todir="${report.loc}">
            <fileset dir="${report.loc}">
                <include name="TEST-*.xml" />
            </fileset>

            <report format="frames" todir="${report.loc}/html" />
        </junitreport>

        <copy todir="./test-reports">
            <fileset dir="${report.loc}"/>
        </copy>  

        <echo>Generation complete</echo>
    </target>

如您所见,我使用 flexUnitTasks 运行测试并使用 junitreport 任务生成报告。

【讨论】:

    猜你喜欢
    • 2020-07-01
    • 2021-11-29
    • 1970-01-01
    • 1970-01-01
    • 2020-05-06
    • 2017-10-03
    • 2017-06-07
    • 1970-01-01
    • 2015-06-15
    相关资源
    最近更新 更多