5 #include <tut/tut_console_reporter.hpp>
6 #include <tut/tut_cppunit_reporter.hpp>
54 inline bool tut_main(
int argc,
const char *
const *
const argv, std::ostream &os = std::cerr)
56 std::stringstream usage;
57 usage <<
"Usage: " << argv[0] <<
" [group] [testcase]" << std::endl;
59 usage <<
"Available test groups:" << std::endl;
60 for(groupnames::const_iterator i = gr.begin(); i != gr.end(); ++i)
62 usage <<
" " << *i << std::endl;
67 if(std::string(argv[1]) ==
"-h" ||
68 std::string(argv[1]) ==
"--help" ||
69 std::string(argv[1]) ==
"/?" ||
91 int t = strtol(argv[2], &end, 10);
92 if(end != argv[2] + strlen(argv[2]))
94 throw no_such_test(
"`" + std::string(argv[2]) +
"` should be a number");
98 if(!runner.get().
run_test(argv[1], t, tr) || tr.result == test_result::dummy)
100 throw no_such_test(
"No testcase `" + std::string(argv[2]) +
"` in group `" + argv[1] +
"`");
Definition: tut_exception.hpp:68
bool run_test(const std::string &group_name, int n, test_result &tr) const
Definition: tut_runner.hpp:268
bool tut_main(int argc, const char *const *const argv, std::ostream &os=std::cerr)
Definition: tut_main.hpp:54
std::vector< std::string > groupnames
Definition: tut_runner.hpp:107
void run_tests() const
Definition: tut_runner.hpp:222
const groupnames list_groups() const
Definition: tut_runner.hpp:209
Definition: tut_result.hpp:69