void object::test<2>() { const char *argv1[] = { "self_test", "ensure", "1" }; ensure_equals( tut_main(3, argv1), true ); const char *argv2[] = { "self_test", "ensure" }; ensure_equals( tut_main(2, argv2), true ); }
void object::test<1>() { const char *argv1[] = { "self_test", "dummy", "five" }; ensure_THROW( tut_main(3, argv1), no_such_test ); const char *argv2[] = { "self_test", "dummy", "5" }; ensure_THROW( tut_main(3, argv2), no_such_group ); const char *argv3[] = { "self_test", "main", "99" }; ensure_THROW( tut_main(3, argv3), no_such_test ); }
void object::test<3>() { std::string line; { std::stringstream ss; const char *argv1[] = { "self_test", "--help" }; ensure_equals( tut_main(2, argv1, ss), false ); std::getline(ss, line); ensure_equals(line, "Usage: self_test [group] [testcase]"); } { std::stringstream ss; const char *argv2[] = { "self_test", "-h" }; ensure_equals( tut_main(2, argv2, ss), false ); const char *argv3[] = { "self_test", "/?" }; ensure_equals( tut_main(2, argv3, ss), false ); } }
void object::test<4>() { std::stringstream ss; const char *argv2[] = { "self_test", "1", "2", "3" }; ensure_equals( tut_main(4, argv2, ss), false ); }
int main(int argc, char** argv) { return tut_main(argc, argv, TUT_REPLICATIONS | TUT_REPLICATIONS_PER_WI); }