diff --git a/Makefile b/Makefile index bd298ba..b8640c5 100644 --- a/Makefile +++ b/Makefile @@ -19,12 +19,12 @@ debug: compile-debug: clean @echo $(call MSG,"Compiling in debug mode ...") make compile-setup - cd tmp; erlc -d -W +debug_info *.erl; cp amf3.beam ../ebin + cd tmp; erlc -d -W +debug_info *.erl; cp amf0.beam amf3.beam ../ebin compile-release: clean @echo $(call MSG,"Compiling ...") make compile-setup - cd tmp; erlc -W *.erl; cp amf3.beam ../ebin + cd tmp; erlc -W *.erl; cp amf0.beam amf3.beam ../ebin analyze: compile-debug make analyze-coverage @@ -32,7 +32,7 @@ analyze: compile-debug analyze-coverage: @echo $(call MSG,"Analyzing Code Coverage ...") - cd tmp; erl -noshell -eval "test_coverage:analyze(amf3)" -s init stop + cd tmp; erl -noshell -eval "test_coverage:analyze([amf0, amf3])" -s init stop analyze-dialyzer: @echo $(call MSG,"Analyzing with Dialyzer ...") @@ -47,7 +47,7 @@ docs: tests: @echo $(call MSG,"Running Tests ...") - cd tmp; erl -noshell -eval "eunit:test(amf3)" -s init stop + cd tmp; erl -noshell -eval "eunit:test([amf0,amf3])" -s init stop tests-verbose: @echo $(call MSG,"Running Tests ...") diff --git a/src/amf3.erl b/src/amf3.erl index 3cb0dc1..180f05f 100644 --- a/src/amf3.erl +++ b/src/amf3.erl @@ -1,19 +1,17 @@ -%%%%========================================================================= +%%%%=================================================================================================================== %% %% amf3 %% -%% @author Mrinal Wadhwa < email@mrinalwadhwa.com > -%% [ http://www.mrinalwadhwa.com ] +%% @author Mrinal Wadhwa < email@mrinalwadhwa.com > [ http://www.mrinalwadhwa.com ] %% -%% @doc This module can be used to serialize and deserialize data to/from -%% Action Message Format (AMF) 3, which is a compact binary format used by -%% Adobe Flash Player to serialize ActionScript object graphs +%% @doc This module can be used to serialize and deserialize data to/from Action Message Format (AMF) 3, which is a +%% compact binary format used by Adobe Flash Player to serialize ActionScript object graphs %% %% @reference AMF 3 Specification %% %% @end %% -%%%%========================================================================== +%%%%=================================================================================================================== -module(amf3). -export([decode/1, encode/1]). diff --git a/test/test_coverage.erl b/test/test_coverage.erl index 4c26a4e..6b74178 100644 --- a/test/test_coverage.erl +++ b/test/test_coverage.erl @@ -1,16 +1,17 @@ -module(test_coverage). -export([analyze/1]). +analyze(Modules) when is_list(Modules) -> lists:foreach(fun analyze/1, Modules); analyze(Module) -> cover:start(), cover:compile_module(Module), - amf3_tests:test(), - {ok,{amf3,{Covered,UnCovered}}} = cover:analyse(Module,coverage,module), + eunit:test(Module), + {ok,{_,{Covered,UnCovered}}} = cover:analyse(Module,coverage,module), {ok,File} = cover:analyse_to_file(Module), Total = Covered + UnCovered, Coverage = Covered/Total * 100, - io:fwrite("~n~nCoverage Analysis: ~n",[]), - io:fwrite("========================== ~n~n",[]), + io:fwrite("~n~nCoverage Analysis: ~n"), + io:fwrite("========================== ~n~n"), io:fwrite("Module: ~w~n",[Module]), io:fwrite("Executable Lines: ~w~n",[Total]), io:fwrite("Covered Lines: ~w~n",[Covered]),