ソースを参照

Merge 9695576d8a into 4c0bfbc0fa

pull/120/merge
Paul Fisher 8年前
committed by GitHub
コミット
0981d7e52d
5個のファイルの変更28行の追加3行の削除
  1. +2
    -0
      .gitignore
  2. +9
    -1
      rebar.config
  3. +3
    -1
      test/jiffy_01_yajl_tests.erl
  4. +2
    -1
      test/jiffy_10_short_double_tests.erl
  5. +12
    -0
      test/jiffy_util.hrl

+ 2
- 0
.gitignore ファイルの表示

@ -8,3 +8,5 @@ deps
erln8.config
hexer.config
TEST-*.xml
*.d
_build

+ 9
- 1
rebar.config ファイルの表示

@ -40,6 +40,14 @@
]}.
{plugins, [
rebar_gdb_plugin
rebar_gdb_plugin, pc
]}.
{provider_hooks,
[
{pre,
[
{compile, {pc, compile}},
{clean, {pc, clean}}
]}
]}.

+ 3
- 1
test/jiffy_01_yajl_tests.erl ファイルの表示

@ -5,6 +5,7 @@
-include_lib("eunit/include/eunit.hrl").
-include("jiffy_util.hrl").
yajl_test_() ->
@ -19,7 +20,7 @@ gen({Name, Json, Erl}) ->
read_cases() ->
CasesPath = filename:join(["..", "test", "cases", "*.json"]),
CasesPath = filename:join([cases_path(), "*.json"]),
FileNames = lists:sort(filelib:wildcard(CasesPath)),
lists:map(fun(F) -> make_pair(F) end, FileNames).
@ -30,3 +31,4 @@ make_pair(FileName) ->
ErlFname = BaseName ++ ".eterm",
{ok, [Term]} = file:consult(ErlFname),
{filename:basename(BaseName), Json, Term}.

+ 2
- 1
test/jiffy_10_short_double_tests.erl ファイルの表示

@ -8,7 +8,8 @@
-include("jiffy_util.hrl").
filename() -> "../test/cases/short-doubles.txt".
filename() ->
cases_path() ++ "/short-doubles.txt".
short_double_test_() ->

+ 12
- 0
test/jiffy_util.hrl ファイルの表示

@ -25,3 +25,15 @@ enc(V) ->
enc(V, Opts) ->
iolist_to_binary(jiffy:encode(V, Opts)).
%% rebar runs eunit with PWD as .eunit/
%% rebar3 runs eunit with PWD as ./
%% this adapts to the differences
cases_path() ->
Path = "test/cases",
AltPath = "../" ++ Path,
case filelib:is_dir( Path ) of
true -> Path;
false -> AltPath
end.

読み込み中…
キャンセル
保存