// Print a summary of what was run and the outcome. void print_summary(const char* suitename) const noexcept { auto out = failure_count() ? stderr : stdout; std::fprintf(out, "Summary for testsuite %s:\n", suitename); std::fprintf(out, " %lu of %lu test cases passed.\n", m_testcase_failures, m_testcases - m_unsupported); std::fprintf(out, " %lu of %lu assertions passed.\n", m_assertions - (m_warning_failures + m_check_failures + m_require_failures), m_assertions); std::fprintf(out, " %lu unsupported test case%s.\n", m_unsupported, (m_unsupported != 1 ? "s" : "")); }
int main(void) { clock_t inicio = clock(); /* Ejecuta todas las pruebas unitarias. */ printf("~~~ PRUEBAS DEL ALUMNO ~~~\n"); pruebas_lista_alumno(); double tiempo = clock() - inicio; printf("el tiempo de ejecucion fue : %f \n", tiempo * 1.00 / CLOCKS_PER_SEC); return failure_count() > 0; }
int main(int argc, char *argv[]) { if (argc > 1) { // Asumimos que nos están pidiendo pruebas de volumen. long largo = strtol(argv[1], NULL, 10); pruebas_volumen_catedra((size_t) largo); return 0; } printf("~~~ PRUEBAS CÁTEDRA ~~~\n"); pruebas_hash_catedra(); return failure_count() > 0; }
void unit_test::summarize( void ) { if ( _quiet > 0 && _quiet < 3 ) { if ( success_count() == run_count() ) std::clog << ansi::green << " SUCCESS " << ansi::reset << _name << ": " << run_count() << " / " << run_count() << " passed" << std::endl; else { std::clog << ansi::red << " FAILURE " << ansi::reset << _name << ": ( " << ansi::green << success_count() << ansi::reset << ", " << ansi::red << failure_count() << ansi::reset << " ) / " << run_count() << std::endl; } } }