2

次のディレクトリ構造があります。

myapp
├── apps
│   ├── myapp
│   ├── myotherapp
│   └── myapp_common
├── deps
│   ├── cowboy
......

myappメインディレクトリで次のように rebar を使用して eunit を実行します。

./rebar skip_deps=true eunit

の 3 つのアプリに対して eunit を正しく実行しますapps/。その後、親myappディレクトリで eunit を実行しようとし、次のエラーをスローします。

......
==> myapp (eunit)
ERROR: eunit failed while processing /home/msheikh/myapp: {'EXIT',{{badmatch,{error,{1,
                           "cp: missing destination file operand after `.eunit'\nTry `cp --help' for more information.\n"}}},
         [{rebar_file_utils,cp_r,2,[]},
          {rebar_eunit,eunit,2,[]},
          {rebar_core,run_modules,4,[]},
          {rebar_core,execute,4,[]},
          {rebar_core,process_dir,4,[]},
          {rebar_core,process_commands,2,[]},
          {rebar,main,1,[]},
          {escript,run,2,[{file,"escript.erl"},{line,727}]}]}}

質問:これを修正したり、eunit が親myappディレクトリに対して実行されないようにするにはどうすればよいですか?

メイン ディレクトリのrebar.configファイルはmyapp次のようになります。

{lib_dirs, ["deps", "apps"]}.

{deps, [
        {lager, ".*", {git, "https://github.com/basho/lager.git", {branch, "master"}}},
        {jsx, ".*", {git, "git://github.com/talentdeficit/jsx.git", {tag, "v0.9.0"}}},
        {cowboy, "", {git, "git://github.com/extend/cowboy.git", {branch, "master"}}},
        ....
       ]}.

{require_otp_vsn, "R15"}.

{escript_incl_apps, [getopt]}.

{erl_opts, [
            debug_info, 
            warn_missing_spec,
            {parse_transform, lager_transform}
           ]}.

{eunit_opts, [verbose]}.

{validate_app_modules, false}.

{sub_dirs, [
            "apps/myapp/",
            "apps/myotherapp/",
            "apps/myapp_common/"]}.
4

1 に答える 1

0

私は同じプロジェクト構造を持っていますが、うまくいきます。

  1. 最上位ディレクトリにsrctest、フォルダがありませんか?ebin
  2. そうでない場合、あなたの場合はどうなりますmkdir .eunitか? (これを維持することを提案しているわけではありませんが、そこから解決策を探してください)。
于 2012-07-04T13:43:40.427 に答える