|
@@ -17,11 +17,16 @@ EDOC_OPTS = {stylesheet_file,"priv/edoc-style.css"},{todo,true}
|
|
|
|
|
|
include erlang.mk
|
|
|
|
|
|
-.PHONY: gh-pages eunit-coverage
|
|
|
+.PHONY: gh-pages eunit eunit-report
|
|
|
+
|
|
|
+eunit:
|
|
|
+ @mkdir -p .eunit
|
|
|
+ @rm -f .eunit/index.html # make sure we don't get an old one if cover=false
|
|
|
+ @rebar eunit | tee .eunit/output
|
|
|
|
|
|
# Update the local 'gh-pages' branch with pregenerated output files
|
|
|
# (trick from https://groups.google.com/forum/#!topic/github/XYxkdzxpgCo)
|
|
|
-gh-pages: docs eunit-coverage
|
|
|
+gh-pages: docs eunit-report
|
|
|
@if [ $$(git name-rev --name-only HEAD) != master ] ; then \
|
|
|
echo "Not on master. Aborting." ; \
|
|
|
false ; \
|
|
@@ -39,16 +44,13 @@ gh-pages: docs eunit-coverage
|
|
|
|
|
|
# Build eunit.html containing the coverage report and the eunit output in the
|
|
|
# doc directory.
|
|
|
-eunit-coverage:
|
|
|
- @mkdir -p .eunit
|
|
|
- @rm -f .eunit/index.html # make sure we don't get an old one if cover=false
|
|
|
- @rebar eunit | tee .eunit/output
|
|
|
+eunit-report: eunit
|
|
|
@(echo '<!DOCTYPE html>' ; \
|
|
|
cat .eunit/index.html | sed 's!</body></html>!!' ; \
|
|
|
echo '<h3>Output of <code>make eunit</code></h3><pre>' ; \
|
|
|
sed 's/&/\&/g; s/</\</g; s/>/\>/g;' .eunit/output ; \
|
|
|
echo '</pre>' ; \
|
|
|
- echo '<p><em>Generated using EUnit,' ; \
|
|
|
+ echo '<p><em>Generated using rebar and EUnit,' ; \
|
|
|
date -u '+%d %h %Y %H:%M:%S UTC.' ; \
|
|
|
echo '</em></p>' ; \
|
|
|
echo '</body></html>') > doc/eunit.html
|