Ant exec的含义是什么结果:128

时间:2012-03-10 09:30:57

标签: ant exec

我的蚂蚁在执行"<exec excultable="c:\myExe.exe"/>"时被停止了,结果代码只是"<message priority="error"><![CDATA[Result: 128]]></message>"。我不知道那是什么意思。

我试图搜索一些信息,如:错误代码128 ---没有这样的exe文件,但我没有。 有人可以帮我解释一下这是什么意思吗?

由于

Oh sorry.
More info:

<macrodef name="gtest-layer-macro">
    <attribute name="execfile"/>
    <attribute name="layerpath" default=""/>
    <attribute name="outputDir" default="${basedir}/${reports}/gtest"/>
    <attribute name="reportfile" default="@{outputDir}/gtest_report.xml"/>
    <sequential>
        <check-layer-path layerpath="@{layerpath}"/>
        <if>
            <and>
                <length string="@{execfile}" when="gt" length="0" trim="true"/>
                <available file="@{execfile}"/>
            </and>
            <then>
                <var name="##report.dir##" unset="true"/>
                <dirname property="##report.dir##" file="@{reportfile}"/>
                <mkdir dir="${##report.dir##}"/>
                <exec executable="@{execfile}">
                    <arg value="--gtest_output=&quot;xml:@{reportfile}&quot;"/>
                </exec>
            </then>
        </if>
    </sequential>
</macrodef>

当我运行<exec>时,出现“错误结果:128”。

“@ {execfile}”是一个gtest.exe文件(用于测试模块的exe文件),当我双击它时它可以正常运行,它可以在控制台中打印单元测试结果;运行带有“--gtest_output =”xml:@ {reportfile}“”的CMD也可以在控制台中打印单元测试结果,并输出一个单元测试报告(.xml文件)。我已经更改了另一个.exe而不是“gtest.exe”,它也是对的。 所以,我不知道我哪里错了。

1 个答案:

答案 0 :(得分:0)

[exec] Result:128是一个无法找到/不存在的进程。至少这是我从Ant目标中发现的,在某些测试结束时杀死任何剩余的进程。当我要杀死的进程没有运行时,我得到了那个结果。我的构建日志输出如下所示;

[shutdown.server] exec
    [13:45:33][exec] ERROR: The process "firefox.exe" not found.
    [13:45:34][exec] Result: 128

因此,如果该结果来自.exe的执行,那么我会检查路径以确保exe可用。