Skip to content

Commit 4b27d3e

Browse files
author
Loïc Hoguin
committed
Use a separate rebar.config file for running tests
1 parent 85ed79e commit 4b27d3e

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

Makefile

+24-12
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,53 @@
11
# See LICENSE for licensing information.
22

3+
PROJECT = cowboy
4+
35
DIALYZER = dialyzer
46
REBAR = rebar
57

68
all: app
79

8-
app: deps
9-
@$(REBAR) compile
10+
# Application.
1011

1112
deps:
1213
@$(REBAR) get-deps
1314

15+
app: deps
16+
@$(REBAR) compile
17+
18+
docs:
19+
@$(REBAR) doc skip_deps=true
20+
1421
clean:
1522
@$(REBAR) clean
1623
rm -f test/*.beam
1724
rm -f erl_crash.dump
1825

19-
tests: clean app eunit ct
26+
# Tests.
27+
28+
deps/proper:
29+
@$(REBAR) -C rebar.tests.config get-deps
30+
cd deps/proper && $(REBAR) compile
2031

21-
inttests: clean app eunit intct
32+
tests: clean deps/proper app eunit ct
33+
34+
inttests: clean deps/proper app eunit intct
2235

2336
eunit:
24-
@$(REBAR) eunit skip_deps=true
37+
@$(REBAR) -C rebar.tests.config eunit skip_deps=true
2538

2639
ct:
27-
@$(REBAR) ct skip_deps=true suites=http,proper,ws
40+
@$(REBAR) -C rebar.tests.config ct skip_deps=true suites=http,proper,ws
2841

2942
intct:
30-
@$(REBAR) ct skip_deps=true suites=http,proper,ws,autobahn
43+
@$(REBAR) -C rebar.tests.config ct skip_deps=true suites=http,proper,ws,autobahn
44+
45+
# Dialyzer.
3146

3247
build-plt:
33-
@$(DIALYZER) --build_plt --output_plt .cowboy_dialyzer.plt \
48+
@$(DIALYZER) --build_plt --output_plt .$(PROJECT).plt \
3449
--apps kernel stdlib sasl inets crypto public_key ssl
3550

3651
dialyze:
37-
@$(DIALYZER) --src src --plt .cowboy_dialyzer.plt --no_native \
52+
@$(DIALYZER) --src src --plt .$(PROJECT).plt --no_native \
3853
-Werror_handling -Wrace_conditions -Wunmatched_returns # -Wunderspecs
39-
40-
docs:
41-
@$(REBAR) doc skip_deps=true

rebar.config

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{cover_enabled, true}.
2-
{deps, [
3-
{proper, "1.0",
4-
{git, "git://github.com/manopapad/proper.git", {tag, "v1.0"}}}
5-
]}.
6-
{eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "."}]}}]}.
71
{erl_opts, [
82
%% bin_opt_info,
93
%% warn_missing_spec,

rebar.tests.config

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{cover_enabled, true}.
2+
{deps, [
3+
{proper, "1.0",
4+
{git, "git://github.com/manopapad/proper.git", {tag, "v1.0"}}}
5+
]}.
6+
{eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "."}]}}]}.
7+
{erl_opts, []}.

0 commit comments

Comments
 (0)