I have some erlang file(.erl).And I compile them. Now I want to use some function to generate a xml which is about the compling info of these files.
Here is a address, http://www.erlang.org/doc/apps/eunit/eunit.pdf
In this pdf,There is a function eunit:test/2 which can generate a xml file.
eunit:test([fib, eunit_examples], [{report,{eunit_surefire,[{dir,"."}]}}]).
But i don't know these parameters represent. I just know fib = modulename dir = generate location.What about eunit_examples? ,report? ,eunit_surefire?
I'm not really sure this is the function you are looking for. Eunit is a testing framework, and thus the function
will give you information about any testing functions you have written within the modules.
If indeed you are looking to generate reports on those tests, in XML format, you simply use the form:
where
MODULES
is a list of any modules you want to do testing of, and everything else stays the same (for example,fib
andeunit_examples
are the two modules that are being tested in the example you gave.)The
report
atom says that you want to generate a report, and theeunit_surefire
atom says what format to generate the report with. I'm not sure there are any other ways to generate the reports with XML besides usingeunit_surefire
.