Skip to content

Commit

Permalink
statted writing a module for amf0
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinalwadhwa committed Jan 9, 2010
1 parent 3ed331a commit af315d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -19,20 +19,20 @@ 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
make analyze-dialyzer

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 ...")
Expand All @@ -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 ...")
Expand Down
12 changes: 5 additions & 7 deletions 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 <a href="http://bit.ly/amf-spec">AMF 3 Specification</a>
%%
%% @end
%%
%%%%==========================================================================
%%%%===================================================================================================================

-module(amf3).
-export([decode/1, encode/1]).
Expand Down
9 changes: 5 additions & 4 deletions 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]),
Expand Down

0 comments on commit af315d1

Please sign in to comment.