Permalink
Browse files

integrating coverize for coverage analysis

  • Loading branch information...
1 parent 4bc1108 commit 582eeeaae79dafbd48c65b2197048db3a1b95128 @mmullis mmullis committed with mmullis User Jan 28, 2009
View
4 .gitignore
@@ -1,3 +1,5 @@
*.dump
.DS_Store
-http_servers
+http_servers
+test/ebin
+coverage
View
12 Emakefile
@@ -1,31 +1,31 @@
% Compile Nitrogen Files.
-{ './src/*', [
+{ './src/*', [ debug_info,
{ i, "./include" },
{ outdir, "./ebin" }
]}.
-{ './src/*/*', [
+{ './src/*/*', [ debug_info,
{ i, "./include" },
{ outdir, "./ebin" }
]}.
-{ './src/*/*/*', [
+{ './src/*/*/*', [ debug_info,
{ i, "./include" },
{ outdir, "./ebin" }
]}.
% Compile the Nitrogen test files
-{ './test/src/*', [
+{ './test/src/*', [ debug_info,
{ i, "./include" },
{ outdir, "./test/ebin" }
]}.
-{ './test/src/*/*', [
+{ './test/src/*/*', [ debug_info,
{ i, "./include" },
{ outdir, "./test/ebin" }
]}.
-{ './test/src/*/*/*', [
+{ './test/src/*/*/*', [ debug_info,
{ i, "./include" },
{ outdir, "./test/ebin" }
]}.
View
6 Makefile
@@ -6,9 +6,13 @@ compile:
erl -make
clean:
+ rm -rf ./coverage/*.*
rm -rf ./ebin/*.*
rm -rf ./test/ebin/*.*
test: compile
- erl -noshell -pa ebin -pa test/ebin -s test_suite test -s init stop
+ erl -noshell -pa ebin -pa test/ebin -s init stop
+coverage: compile
+ mkdir -p coverage
+ erl -noshell -pa ebin -pa test/ebin -s eunit_helper run_cover -s init stop
View
4 test/src/elements/html/element_br_test.erl
@@ -22,5 +22,7 @@ new_br_with_style() ->
basic_test_() ->
[?_assertEqual("<br id='1' class='br'/>",new_br_1()),
?_assertEqual("<br id='2' class='br t_br'/>",new_br_2()),
- ?_assertEqual("<br id='3' class='br t_br' style='color: cyan;'/>",new_br_with_style())
+ ?_assertEqual("<br id='3' class='br t_br' style='color: cyan;'/>",new_br_with_style()),
+ ?_assertEqual([module,id,actions,show_if,class,style],
+ element_br:reflect())
].
View
4 test/src/elements/html/element_hr_test.erl
@@ -22,5 +22,7 @@ new_hr_3() ->
basic_test_() ->
[?_assertEqual("<hr size='1' id='1' class='hr'/>",new_hr_1()),
?_assertEqual("<hr size='1' id='2' class='hr t_hr'/>",new_hr_2()),
- ?_assertEqual("<hr size='1' id='3' class='hr t_hr' style='color: cyan;'/>",new_hr_3())
+ ?_assertEqual("<hr size='1' id='3' class='hr t_hr' style='color: cyan;'/>",new_hr_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style],
+ element_hr:reflect())
].
View
4 test/src/elements/html/element_image_test.erl
@@ -22,5 +22,7 @@ new_image_3() ->
basic_test_() ->
[?_assertEqual("<img id='1' class='image'/>",new_image_1()),
?_assertEqual("<img id='2' class='image t_image'/>",new_image_2()),
- ?_assertEqual("<img id='3' class='image t_image' style='color: cyan;' src='http://an_image.com/sample/image.jpg'/>",new_image_3())
+ ?_assertEqual("<img id='3' class='image t_image' style='color: cyan;' src='http://an_image.com/sample/image.jpg'/>",new_image_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,image],
+ element_image:reflect())
].
View
4 test/src/elements/html/element_label_test.erl
@@ -22,5 +22,7 @@ new_label_3() ->
basic_test_() ->
[?_assertEqual("<span id='1' class='label'></span>",new_label_1()),
?_assertEqual("<span id='2' class='label t_label'></span>",new_label_2()),
- ?_assertEqual("<span id='3' class='label t_label' style='color: cyan;'>Username:</span>",new_label_3())
+ ?_assertEqual("<span id='3' class='label t_label' style='color: cyan;'>Username:</span>",new_label_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,text,html_encode],
+ element_label:reflect())
].
View
4 test/src/elements/html/element_link_test.erl
@@ -33,5 +33,7 @@ basic_test_() ->
?_assertEqual("<a id='3' href='javascript:' class='link'></a>", new_link_3()),
?_assert(eunit_helper:regexpMatch("<a id='4' href='javascript:' class='link'><img id='.*?' class='image' src='/path/to/image.gif'/></a>",
new_link_4())),
- ?_assertEqual("<a id='5' href='not_javascript' class='link'>LINK&nbsp;TEXTA LINK BODY</a>", new_link_5())
+ ?_assertEqual("<a id='5' href='not_javascript' class='link'>LINK&nbsp;TEXTA LINK BODY</a>", new_link_5()),
+ ?_assertEqual([module,id,actions,show_if,class,style,text,body, html_encode,url,postback],
+ element_link:reflect())
].
View
4 test/src/elements/html/element_list_test.erl
@@ -38,5 +38,7 @@ basic_test_() ->
?_assertEqual("<ul id='3' class='list t_list' style='color: cyan;'>SOME BODY</ul>",new_list_3()),
?_assertEqual("<ol id='4' class='list'></ol>",new_list_4()),
?_assertEqual("<ol id='5' class='list t_list'></ol>",new_list_5()),
- ?_assertEqual("<ol id='6' class='list t_list' style='color: cyan;'>SOME BODY</ol>",new_list_6())
+ ?_assertEqual("<ol id='6' class='list t_list' style='color: cyan;'>SOME BODY</ol>",new_list_6()),
+ ?_assertEqual([module,id,actions,show_if,class,style,numbered,body],
+ element_list:reflect())
].
View
4 test/src/elements/html/element_listitem_test.erl
@@ -22,5 +22,7 @@ new_listitem_3() ->
basic_test_() ->
[?_assertEqual("<li id='1' class='listitem'></li>",new_listitem_1()),
?_assertEqual("<li id='2' class='listitem t_listitem'></li>",new_listitem_2()),
- ?_assertEqual("<li id='3' class='listitem t_listitem' style='color: cyan;'>http://an_listitem.com/sample/listitem.jpg</li>",new_listitem_3())
+ ?_assertEqual("<li id='3' class='listitem t_listitem' style='color: cyan;'>http://an_listitem.com/sample/listitem.jpg</li>",new_listitem_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,body,text,html_encode],
+ element_listitem:reflect())
].
View
4 test/src/elements/html/element_literal_test.erl
@@ -22,5 +22,7 @@ new_literal_3() ->
basic_test_() ->
[?_assertEqual("",new_literal_1()),
?_assertEqual("",new_literal_2()),
- ?_assertEqual("http://an_literal.com/sample/literal.jpg",new_literal_3())
+ ?_assertEqual("http://an_literal.com/sample/literal.jpg",new_literal_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,text,html_encode],
+ element_literal:reflect())
].
View
4 test/src/elements/html/element_p_test.erl
@@ -22,5 +22,7 @@ new_p_3() ->
basic_test_() ->
[?_assertEqual("<p id='1' class='p'/>",new_p_1()),
?_assertEqual("<p id='2' class='p t_p'/>",new_p_2()),
- ?_assertEqual("<p id='3' class='p t_p' style='color: cyan;'/>",new_p_3())
+ ?_assertEqual("<p id='3' class='p t_p' style='color: cyan;'/>",new_p_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style],
+ element_p:reflect())
].
View
4 test/src/elements/html/element_span_test.erl
@@ -22,5 +22,7 @@ new_span_3() ->
basic_test_() ->
[?_assertEqual("<span id='1'></span>",new_span_1()),
?_assertEqual("<span id='2' class='t_span'></span>",new_span_2()),
- ?_assertEqual("<span id='3' class='t_span' style='color: cyan;'>Some&nbsp;Text</span>", new_span_3())
+ ?_assertEqual("<span id='3' class='t_span' style='color: cyan;'>Some&nbsp;Text</span>", new_span_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,text, html_encode],
+ element_span:reflect())
].
View
4 test/src/elements/html/element_value_test.erl
@@ -22,5 +22,7 @@ new_value_3() ->
basic_test_() ->
[?_assertEqual("<span id='1' class='value'></span>",new_value_1()),
?_assertEqual("<span id='2' class='value t_value'></span>",new_value_2()),
- ?_assertEqual("<span id='3' class='value t_value' style='color: cyan;'>TEXT</span>",new_value_3())
+ ?_assertEqual("<span id='3' class='value t_value' style='color: cyan;'>TEXT</span>",new_value_3()),
+ ?_assertEqual([module,id,actions,show_if,class,style,text,html_encode],
+ element_value:reflect())
].
View
27 test/src/eunit_helper.erl
@@ -1,6 +1,6 @@
%%% File : eunit_helper.erl
%%% Author : Michael Mullis <michael@mullistechnologies.com>
-%%% Description : Some helper functions to enhance tests
+%%% Description : Some helper functions to enhance tests and coverage analysis
%%% Created : 27 Jan 2009 by Michael Mullis <michael@mullistechnologies.com>
-module(eunit_helper).
@@ -18,3 +18,28 @@ regexpMatch(Pattern, Actual) ->
_ ->
false
end.
+
+%% Wrapper for cover to make command line calling easy
+run_cover() ->
+ %% TODO: Make this list dynamic
+ SourceDirs = [
+ "./Quickstart/src",
+ "./Quickstart/src/reference",
+ "./Quickstart/src/samples",
+ "./src",
+ "./src/actions",
+ "./src/elements/forms",
+ "./src/elements/heading",
+ "./src/elements/html",
+ "./src/elements/layout",
+ "./src/elements/other",
+ "./src/elements/table",
+ "./src/lib",
+ "./src/platforms",
+ "./src/project",
+ "./src/validators"
+ "./test/src",
+ "./test/src/elements/html"
+ ],
+
+ coverize:run(SourceDirs,test_suite).

0 comments on commit 582eeea

Please sign in to comment.