Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #84 from basho/pevm-io-mode-tests

eunit test enhancements.
  • Loading branch information...
commit 83ec5b4b20a7815cdcdb91617043ce9f268c403a 2 parents fbbf11e + deef470
@evanmcc evanmcc authored
Showing with 22 additions and 3 deletions.
  1. +1 −0  .travis.yml
  2. +11 −2 Makefile
  3. +10 −1 src/bitcask.erl
View
1  .travis.yml
@@ -1,4 +1,5 @@
language: erlang
+script: "make test"
notifications:
webhooks: http://basho-engbot.herokuapp.com/travis?key=8b53d962594d0253d20002380cfb837fb81b928b
email: eng@basho.com
View
13 Makefile
@@ -12,14 +12,23 @@ endif
all: deps compile
compile:
- $(REBAR_BIN) compile eunit
+ $(REBAR_BIN) compile
deps:
$(REBAR_BIN) get-deps
-clean:
+clean:
$(REBAR_BIN) clean
+test: deps compile eunit_erlang eunit_nif
+
+eunit_erlang:
+ IOMODE="erlang" $(REBAR_BIN) skip_deps=true eunit
+
+eunit_nif:
+ IOMODE="nif" $(REBAR_BIN) skip_deps=true eunit
+
+
# Release tarball creation
# Generates a tarball that includes all the deps sources so no checkouts are necessary
archivegit = git archive --format=tar --prefix=$(1)/ HEAD | (cd $(2) && tar xf -)
View
11 src/bitcask.erl
@@ -1309,8 +1309,17 @@ default_dataset() ->
%% HACK: Terrible hack to ensure that the .app file for
%% bitcask is available on the code path. Assumption here
%% is that we're running in .eunit/ as part of rebar.
+%% MORE HACK: init the io mode (nif or erlang) here.
a0_test() ->
- code:add_pathz("../ebin").
+ code:add_pathz("../ebin"),
+ application:start(erlang),
+ Mode0 = case os:getenv("IOMODE") of
+ false -> "erlang";
+ Else -> Else
+ end,
+ Mode = list_to_atom(Mode0),
+ application:set_env(bitcask, io_mode, Mode),
+ error_logger:info_msg("Set IO mode to: ~p", [Mode]).
roundtrip_test() ->
os:cmd("rm -rf /tmp/bc.test.roundtrip"),
Please sign in to comment.
Something went wrong with that request. Please try again.