【问题标题】:Rebar eunit runs non native (non Hipe) codeRebar eunit 运行非本地(非 Hipe)代码
【发布时间】:2015-07-22 18:04:18
【问题描述】:

我已经使用

编译了我的 Erlang 模块
rebar compile

在 rebar.config 中使用以下选项

{erl_opts, [native, {hipe, [verbose]}, warnings_as_errors, debug_info]}.
{eunit_compile_opts, [native, {hipe, [verbose]}, warnings_as_errors, debug_info]}.

我看到代码确实被编译为原生,因为我在编译过程中看到了 Hipe 消息,并且 .beam 文件大小也比非原生编译大。

但是当我运行时

rebar eunit

测试我的模块我总是弄错

 code:is_module_native(?MODULE)

在我的测试模块中。

为什么 rebar 不将我的 eunit 测试作为本机代码运行?

我在 reltool.config 文件中额外添加了这一行,

 {app, hipe, [{incl_cond, include}]},

钢筋 2.1.0-pre 17 20140421_192321 git 2.1.0-pre-166-ged88055

【问题讨论】:

    标签: erlang rebar erl eunit hipe


    【解决方案1】:

    当您使用定义的编译选项运行“rebar eunit”时,您的代码会重新编译

    • {erl_opts, [native, {hipe, [verbose]}, warnings_as_errors, debug_info]}.

    并由定义的编译选项修改

    • {eunit_compile_opts, [???]}.

    您是否检查了这些选项?

    【讨论】:

    • 感谢您的回复。我添加了 eunit_compile_opts (见编辑的问题)。它仍然运行非本地。
    猜你喜欢
    • 2023-03-26
    • 2012-05-05
    • 2013-01-03
    • 2012-12-28
    • 2012-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多