Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor meck into smaller functional modules #82

Merged
merged 11 commits into from
Nov 4, 2012
53 changes: 46 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,53 @@
REBAR=`which rebar || echo ./rebar`
PLTFILE=$(CURDIR)/.deps.plt
APP_DEPS=kernel stdlib eunit tools compiler
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin

all: compile
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
endif

ERL = $(shell which erl)
ifeq ($(ERL),)
$(error "Erlang must be available on this system")
endif

.PHONY: all rebuild compile doc clean test dialyzer typer \
shell clean-plt clean-doc distclean

all: compile dialyzer test doc

rebuild: clean-doc clean all

compile:
@$(REBAR) compile
@$(REBAR) skip_deps=true compile

test: force
@$(REBAR) eunit
doc:
@$(REBAR) skip_deps=true doc

clean:
@$(REBAR) clean
@$(REBAR) skip_deps=true clean

test:
@$(REBAR) skip_deps=true eunit

$(PLTFILE):
- dialyzer --build_plt --apps $(APP_DEPS) --output_plt $(PLTFILE)

dialyzer: compile $(PLTFILE)
@dialyzer --fullpath --plt $(PLTFILE) -pa $(CURDIR)/ebin -c src --src | \
fgrep -v -f ./dialyzer.ignore-warnings

typer:
typer --plt $(PLTFILE) -I include -r src

shell:
@$(ERL) $(ERLFLAGS)

clean-plt:
@rm -rf $(PLTFILE)

clean-doc:
@cd doc; ls * | grep -v overview.edoc | xargs rm -f

force: ;
distclean: clean clean-plt clean-doc
5 changes: 5 additions & 0 deletions dialyzer.ignore-warnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### meck:code_cover.erl has to call this unexported functions to do its
### cover passthrough magic:
Call to missing or unexported function cover:compile_beam/2
Call to missing or unexported function cover:get_term/1
Call to missing or unexported function cover:write/2
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
{dialyzer_opts, [{warnings, [unmatched_returns]}]}.

{cover_enabled, true}.
{cover_print_enabled, true}.
{clean_files, [".eunit", "ebin/*.beam", "test/*.beam"]}.
Loading