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
149
149
150
150
test : test_erlang test_elixir
151
151
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 )
153
157
@ 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 ;
157
159
@ echo " "
158
160
161
+ $(TEST_EBIN ) /% .beam : $(TEST_ERL ) /% .erl
162
+ $(Q ) mkdir -p $(TEST_EBIN )
163
+ $(Q ) $(ERLC ) -o $(TEST_EBIN ) $<
164
+
159
165
test_elixir : test_stdlib test_ex_unit test_doc_test test_mix test_eex test_iex
160
166
161
167
test_doc_test : compile
Original file line number Diff line number Diff line change 1
1
-module (test_helper ).
2
2
-include (" elixir.hrl" ).
3
3
-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
+ ]).
4
14
5
15
test () ->
6
16
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 .
17
21
18
22
% Execute a piece of code and purge given modules right after
19
23
run_and_remove (Fun , Modules ) ->
You can’t perform that action at this time.
0 commit comments