2 #include <boost/program_options.hpp>
3 #include <boost/foreach.hpp>
5 #include <moulette/moulette.hh>
6 #include <moulette/listeners/console-listener.hh>
7 #include <moulette/listeners/xml-listener.hh>
9 namespace po
= boost::program_options
;
11 int main(int argc
, char **argv
)
13 po::options_description
desc("Help");
15 ("help,h", "produce help message")
16 ("tests,t", po::value
< std::vector
<std::string
> >(), "test files");
18 po::positional_options_description pdesc
;
19 pdesc
.add("tests", -1);
22 po::store(po::command_line_parser(argc
, argv
).
23 options(desc
).positional(pdesc
).run(), vm
);
26 if (vm
.count("help")) {
27 std::cout
<< desc
<< "\n";
31 moulette::Moulette
& moul
= moulette::Moulette::instance();
32 if (vm
.count("tests"))
34 BOOST_FOREACH(const std::string
& filename
,
35 vm
["tests"].as
<std::vector
<std::string
> >())
36 moul
.addTest(filename
);
39 moul
.registerListener(*new moulette::ConsoleListener
);
40 moul
.registerListener(*new moulette::XmlListener
);