aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2014-03-25 11:58:11 +0100
committerLoïc Hoguin <[email protected]>2014-03-25 11:58:11 +0100
commitdbc14259d6d8bfef50cc0e7253d07ed322fd9239 (patch)
treeeb96657a11686de24ea8ff5bd5936140561509b3
parenta6626f3b4539b07366034b4953ab2df29e3a9d58 (diff)
downloadcowlib-dbc14259d6d8bfef50cc0e7253d07ed322fd9239.tar.gz
cowlib-dbc14259d6d8bfef50cc0e7253d07ed322fd9239.tar.bz2
cowlib-dbc14259d6d8bfef50cc0e7253d07ed322fd9239.zip
Update erlang.mk
-rw-r--r--erlang.mk23
-rw-r--r--src/cow_http_te.erl5
2 files changed, 14 insertions, 14 deletions
diff --git a/erlang.mk b/erlang.mk
index 1e0a05e..7da0151 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, Loïc Hoguin <[email protected]>
+# Copyright (c) 2013-2014, Loïc Hoguin <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -58,7 +58,7 @@ ifneq ($(wildcard $(RELX_CONFIG)),)
RELX ?= $(CURDIR)/relx
export RELX
-RELX_URL ?= https://github.com/erlware/relx/releases/download/v0.5.2/relx
+RELX_URL ?= https://github.com/erlware/relx/releases/download/v0.6.0/relx
RELX_OPTS ?=
define get_relx
@@ -132,7 +132,7 @@ define compile_dtl
Compile = fun(F) -> \
Module = list_to_atom( \
string:to_lower(filename:basename(F, ".dtl")) ++ "_dtl"), \
- erlydtl_compiler:compile(F, Module, [{out_dir, "ebin/"}]) \
+ erlydtl:compile(F, Module, [{out_dir, "ebin/"}]) \
end, \
_ = [Compile(F) || F <- string:tokens("$(1)", " ")], \
init:stop()'
@@ -209,11 +209,14 @@ clean-docs:
$(foreach dep,$(TEST_DEPS),$(eval $(call dep_target,$(dep))))
+TEST_ERLC_OPTS ?= +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard
+TEST_ERLC_OPTS += -DTEST=1 -DEXTRA=1 +'{parse_transform, eunit_autoexport}'
+
build-test-deps: $(ALL_TEST_DEPS_DIRS)
@for dep in $(ALL_TEST_DEPS_DIRS) ; do $(MAKE) -C $$dep; done
build-tests: build-test-deps
- $(gen_verbose) erlc -v $(ERLC_OPTS) -o test/ \
+ $(gen_verbose) erlc -v $(TEST_ERLC_OPTS) -o test/ \
$(wildcard test/*.erl test/*/*.erl) -pa ebin/
CT_OPTS ?=
@@ -228,7 +231,7 @@ CT_RUN = ct_run \
CT_SUITES ?=
define test_target
-test_$(1): ERLC_OPTS += -DTEST=1 +'{parse_transform, eunit_autoexport}'
+test_$(1): ERLC_OPTS = $(TEST_ERLC_OPTS)
test_$(1): clean deps app build-tests
@if [ -d "test" ] ; \
then \
@@ -240,7 +243,7 @@ endef
$(foreach test,$(CT_SUITES),$(eval $(call test_target,$(test))))
-tests: ERLC_OPTS += -DTEST=1 +'{parse_transform, eunit_autoexport}'
+tests: ERLC_OPTS = $(TEST_ERLC_OPTS)
tests: clean deps app build-tests
@if [ -d "test" ] ; \
then \
@@ -251,16 +254,18 @@ tests: clean deps app build-tests
# Dialyzer.
+DIALYZER_PLT ?= $(CURDIR)/.$(PROJECT).plt
+export DIALYZER_PLT
+
PLT_APPS ?=
DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
-Wunmatched_returns # -Wunderspecs
build-plt: deps app
- @dialyzer --build_plt --output_plt .$(PROJECT).plt \
- --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
+ @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
dialyze:
- @dialyzer --src src --plt .$(PROJECT).plt --no_native $(DIALYZER_OPTS)
+ @dialyzer --src src --no_native $(DIALYZER_OPTS)
# Packages.
diff --git a/src/cow_http_te.erl b/src/cow_http_te.erl
index 7e53779..aa9c6b9 100644
--- a/src/cow_http_te.erl
+++ b/src/cow_http_te.erl
@@ -26,11 +26,6 @@
%% The state type is the same for both identity and chunked.
-type state() :: {non_neg_integer(), non_neg_integer()}.
-%% @todo Add EXTRA to erlang.mk.
--ifdef(TEST).
--define(EXTRA, 1).
--endif.
-
-ifdef(EXTRA).
dripfeed(<< C, Rest/bits >>, Acc, State, F) ->
case F(<< Acc/binary, C >>, State) of