Improve test targets in Makefile

- enable running eunit and retest tests separately
- add neccessary dependencies to each test target so that
  one can just do 'make test' without recompiling changed files
  manually
- enable overwriting retest's log level
- use retest's own Makefile instead of invoking rebar manually
This commit is contained in:
David Kubecka 2015-03-22 16:04:05 +01:00
parent 02de46d01f
commit f3f8f29920

View file

@ -1,10 +1,11 @@
.PHONY: clean dialyzer_warnings xref_warnings deps test .PHONY: clean dialyzer_warnings xref_warnings deps test test_eunit test_inttest
REBAR=$(PWD)/rebar REBAR=$(PWD)/rebar
RETEST=$(PWD)/deps/retest/retest RETEST=$(PWD)/deps/retest/retest
OTPVSNCMD='io:fwrite("~s",[rebar_utils:otp_release()]), halt().' OTPVSNCMD='io:fwrite("~s",[rebar_utils:otp_release()]), halt().'
OTPVSN=$(shell erl -pa ebin/ -noshell -eval $(OTPVSNCMD)) OTPVSN=$(shell erl -pa ebin/ -noshell -eval $(OTPVSNCMD))
PLT_FILENAME=~/.dialyzer_rebar_$(OTPVSN)_plt PLT_FILENAME=~/.dialyzer_rebar_$(OTPVSN)_plt
LOG_LEVEL?=debug
all: all:
./bootstrap ./bootstrap
@ -64,10 +65,14 @@ binary: clean all
deps: deps:
@REBAR_EXTRA_DEPS=1 ./rebar get-deps @REBAR_EXTRA_DEPS=1 ./rebar get-deps
@(cd deps/retest && $(REBAR) compile escriptize) $(MAKE) -C deps/retest
test: test: test_eunit test_inttest
test_eunit: all
@$(REBAR) eunit @$(REBAR) eunit
@$(RETEST) -v inttest
test_inttest: all deps
@$(RETEST) -l $(LOG_LEVEL) inttest
travis: clean debug xref clean all deps test travis: clean debug xref clean all deps test