Browse files

Moved the tests into their own directory and updated the makefile to …

…allow for buildint without the tests
  • Loading branch information...
1 parent 33520ad commit 0efe0048b23f0199d82175426cb471b75825ef36 @dparnell committed May 4, 2012
Showing with 14 additions and 5 deletions.
  1. +4 −1 Makefile
  2. +10 −4 erl_make.erl
  3. 0 {src → test}/dcpu16_core_test.erl
  4. 0 {src → test}/test_suite.erl
View
5 Makefile
@@ -3,9 +3,12 @@ all: test
compile:
erlc -o ebin +debug_info erl_make.erl
-test: compile
+dist: compile
erl -pa ./ebin -eval "case erl_make:make(development) of ok -> halt(0); _ -> halt(1) end." -s init stop -noshell
+test: compile
+ erl -pa ./ebin -eval "case erl_make:make(test) of ok -> halt(0); _ -> halt(1) end." -s init stop -noshell
+
clean:
rm ebin/*.beam
View
14 erl_make.erl
@@ -2,10 +2,16 @@
-export([make/1]).
+post_process(test) ->
+ case make:files(filelib:wildcard("test/*.erl"), [debug_info, {outdir, "ebin"}, {i, "include"}]) of
+ error -> error;
+ _ -> test_suite:test()
+ end;
+
+post_process(_) -> ok.
+
make(Mode) ->
case make:all([{d, Mode}]) of
- error ->
- error;
- _ ->
- test_suite:test()
+ error -> error;
+ _ -> post_process(Mode)
end.
View
0 src/dcpu16_core_test.erl → test/dcpu16_core_test.erl
File renamed without changes.
View
0 src/test_suite.erl → test/test_suite.erl
File renamed without changes.

0 comments on commit 0efe004

Please sign in to comment.