Skip to content

Commit

Permalink
Move test code to separate directory; rework Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Fletcher committed Nov 6, 2008
1 parent 0ac0d56 commit 2a514aa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
34 changes: 19 additions & 15 deletions Makefile
@@ -1,31 +1,35 @@
EFLAGS=-pa ebin -pa ../erlang-fmt/ebin -pa ../eunit/ebin -I../ -Iinclude
SOURCE_FILES := $(wildcard src/*.erl)

ERL := erl $(EFLAGS)
ERLC := erlc -W +debug_info -o ebin

ERL_SOURCES := $(wildcard src/*.erl)
ERL := erl -pa ebin -pa ../erlang-fmt/ebin -s crypto

ERL_OBJECTS := $(ERL_SOURCES:src/%.erl=ebin/%.beam)

all: beam_files

all: objects

objects: $(ERL_OBJECTS)
beam_files: $(SOURCE_FILES:src/%.erl=ebin/%.beam)

ebin/%.beam: src/%.erl
@test -d ebin || mkdir ebin
erlc $(EFLAGS) -W +debug_info -o ebin $<
$(ERLC) $<

ebin/oauth_unit.beam:
$(ERLC) -pa ../eunit/ebin -I../ -Iinclude test/oauth_unit.erl

ebin/oauth_termie.beam:
$(ERLC) test/oauth_termie.erl

clean:
rm -rf ebin/*.beam erl_crash.dump

test: objects
$(ERL) -noshell -s crypto -s oauth_unit test -s init stop
test: beam_files ebin/oauth_unit.beam
@$(ERL) -noshell -s oauth_unit test -s init stop

termie: objects
$(ERL) -noshell -s crypto -s inets -s oauth_termie test -s init stop
termie: beam_files ebin/oauth_termie.beam
@$(ERL) -noshell -s inets -s oauth_termie test -s init stop

shell: objects
@$(ERL) -s crypto -s inets
shell: beam_files
@$(ERL) -s inets

dialyzer:
dialyzer $(EFLAGS) --src -c src/
dialyzer --no_check_plt --src -c src/
File renamed without changes.
3 changes: 1 addition & 2 deletions src/oauth_unit.erl → test/oauth_unit.erl
@@ -1,7 +1,7 @@
-module(oauth_unit).

-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").

-include("oauth_test_macros.hrl").


Expand Down Expand Up @@ -78,4 +78,3 @@ hmac_signature_test_() -> [
"oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal"
])
].
-endif.

0 comments on commit 2a514aa

Please sign in to comment.