File tree Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -149,13 +149,19 @@ release_docs: docs
149149
150150test : test_erlang test_elixir
151151
152- test_erlang : compile
152+ TEST_ERL = lib/elixir/test/erlang
153+ TEST_EBIN = lib/elixir/test/ebin
154+ TEST_ERLS = $(addprefix $(TEST_EBIN ) /, $(addsuffix .beam, $(basename $(notdir $(wildcard $(TEST_ERL ) /* .erl) ) ) ) )
155+
156+ test_erlang : compile $(TEST_ERLS )
153157 @ echo " ==> elixir (eunit)"
154- $(Q ) mkdir -p lib/elixir/test/ebin
155- $(Q ) $(ERLC ) -pa lib/elixir/ebin -o lib/elixir/test/ebin lib/elixir/test/erlang/* .erl
156- $(Q ) $(ERL ) -pa lib/elixir/test/ebin -s test_helper test -s erlang halt;
158+ $(Q ) $(ERL ) -pa $(TEST_EBIN ) -s test_helper test ;
157159 @ echo " "
158160
161+ $(TEST_EBIN ) /% .beam : $(TEST_ERL ) /% .erl
162+ $(Q ) mkdir -p $(TEST_EBIN )
163+ $(Q ) $(ERLC ) -o $(TEST_EBIN ) $<
164+
159165test_elixir : test_stdlib test_ex_unit test_doc_test test_mix test_eex test_iex
160166
161167test_doc_test : compile
Original file line number Diff line number Diff line change 11-module (test_helper ).
22-include (" elixir.hrl" ).
33-export ([test /0 , run_and_remove /2 , throw_elixir /1 , throw_erlang /1 ]).
4+ -define (TESTS , [
5+ atom_test ,
6+ control_test ,
7+ function_test ,
8+ match_test ,
9+ module_test ,
10+ operators_test ,
11+ string_test ,
12+ tokenizer_test
13+ ]).
414
515test () ->
616 application :start (elixir ),
7- eunit :test ([
8- atom_test ,
9- control_test ,
10- function_test ,
11- match_test ,
12- module_test ,
13- operators_test ,
14- string_test ,
15- tokenizer_test
16- ]).
17+ case eunit :test (? TESTS ) of
18+ error -> erlang :halt (1 );
19+ _Res -> erlang :halt (0 )
20+ end .
1721
1822% Execute a piece of code and purge given modules right after
1923run_and_remove (Fun , Modules ) ->
You can’t perform that action at this time.
0 commit comments