couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [01/12] jiffy commit: updated refs/heads/master to 99a3d43
Date Wed, 07 Jun 2017 16:01:46 GMT
Repository: couchdb-jiffy
Updated Branches:
  refs/heads/master d3c00e19d -> 99a3d4378


Add support for rebar3

Allow Jiffy to be used easily in projects using either rebar 2 or 3.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/commit/c7756dae
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/tree/c7756dae
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/diff/c7756dae

Branch: refs/heads/master
Commit: c7756dae9f98a86d0670d5be6539ac8202a1f86a
Parents: 0789c08
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Mar 18 15:48:20 2016 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Thu Sep 29 12:54:33 2016 -0500

----------------------------------------------------------------------
 .gitignore                           |   5 +++++
 enc                                  | Bin 0 -> 23260 bytes
 rebar.config                         |  11 +++--------
 test/jiffy_01_yajl_tests.erl         |   3 ++-
 test/jiffy_10_short_double_tests.erl |   3 ++-
 test/jiffy_util.hrl                  |  13 +++++++++++++
 6 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index e3e5e72..c6154b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,15 @@
 .eunit
+.rebar
 .jiffy.dev
 *.app
 *.beam
+*.d
 *.o
 *.so
+_build
+compile_commands.json
 deps
 erln8.config
 hexer.config
+rebar.lock
 TEST-*.xml

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/enc
----------------------------------------------------------------------
diff --git a/enc b/enc
new file mode 100755
index 0000000..239a351
Binary files /dev/null and b/enc differ

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/rebar.config
----------------------------------------------------------------------
diff --git a/rebar.config b/rebar.config
index 9d26448..33b8186 100644
--- a/rebar.config
+++ b/rebar.config
@@ -33,13 +33,8 @@
 ]}.
 
 {eunit_opts, [
-    verbose,
-    {report, {
-        eunit_surefire, [{dir,"."}]
-    }}
-]}.
-
-{plugins, [
-    rebar_gdb_plugin
+    verbose
 ]}.
 
+{pre_hooks, [{"", compile, "./enc compile"}]}.
+{post_hooks, [{"", clean, "./enc clean"}]}.

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/test/jiffy_01_yajl_tests.erl
----------------------------------------------------------------------
diff --git a/test/jiffy_01_yajl_tests.erl b/test/jiffy_01_yajl_tests.erl
index aedaf71..689c880 100644
--- a/test/jiffy_01_yajl_tests.erl
+++ b/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 = cases_path("*.json"),
     FileNames = lists:sort(filelib:wildcard(CasesPath)),
     lists:map(fun(F) -> make_pair(F) end, FileNames).
 

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/test/jiffy_10_short_double_tests.erl
----------------------------------------------------------------------
diff --git a/test/jiffy_10_short_double_tests.erl b/test/jiffy_10_short_double_tests.erl
index d66e1ea..0b099c1 100644
--- a/test/jiffy_10_short_double_tests.erl
+++ b/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_() ->

http://git-wip-us.apache.org/repos/asf/couchdb-jiffy/blob/c7756dae/test/jiffy_util.hrl
----------------------------------------------------------------------
diff --git a/test/jiffy_util.hrl b/test/jiffy_util.hrl
index 51bd86a..4b714d9 100644
--- a/test/jiffy_util.hrl
+++ b/test/jiffy_util.hrl
@@ -25,3 +25,16 @@ 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(Suffix) ->
+    {ok, Cwd} = file:get_cwd(),
+    Prefix = case filename:basename(Cwd) of
+        ".eunit" -> "..";
+        _ -> "."
+    end,
+    Path = "test/cases",
+    filename:join([Prefix, Path, Suffix]).


Mime
View raw message