예제 #1
0
static void
print_summary (CutConsoleUI *console, CutRunContext *run_context)
{
    const gchar *color;
    gchar *summary;

    color = status_to_color(cut_run_context_get_status(run_context));
    summary = format_summary(run_context);
    print_with_color(console, color, "%s", summary);
    g_free(summary);
    g_print("\n");

    print_with_color(console, color,
                     "%g%% passed", compute_pass_percentage(run_context));
    g_print("\n");
}
예제 #2
0
파일: printer.cpp 프로젝트: agatan/crepe
static void
print_line_number(std::ostream& os, match_type t, int n) {
  if (!opt.line_number) return;
  switch (t) {
  case match_type::exact:
    print_with_color(os, opt.line_color, n);
    break;
  case match_type::after:
    print_with_color(os, opt.line_color, '+');
    break;
  case match_type::before:
    print_with_color(os, opt.line_color, '-');
    break;
  }
  os << ":";
}
예제 #3
0
static void
print_each_attribute (gpointer key, gpointer value, gpointer data)
{
    ConsoleAndStatus *info = (ConsoleAndStatus*)data;
    g_print("\n");
    print_with_color(info->console, status_to_color(info->status),
                     "  %s: %s",
                     (const gchar*)key, (const gchar*)value,
                     NULL);
}
예제 #4
0
static void
cb_start_test_case (CutRunContext *run_context, CutTestCase *test_case,
                    CutConsoleUI *console)
{
    if (console->verbose_level < CUT_VERBOSE_LEVEL_VERBOSE)
        return;

    print_with_color(console, CUT_CONSOLE_COLOR_GREEN_BACK,
                     "%s", cut_test_get_name(CUT_TEST(test_case)));
    g_print(":\n");
}
예제 #5
0
static void
cb_start_test_iterator (CutRunContext *run_context,
                        CutTestIterator *test_iterator,
                        CutConsoleUI *console)
{
    if (console->verbose_level < CUT_VERBOSE_LEVEL_VERBOSE)
        return;

    g_print("  ");
    print_with_color(console, CUT_CONSOLE_COLOR_BLUE_BACK,
                     "%s", cut_test_get_name(CUT_TEST(test_iterator)));
    g_print(":\n");
}
예제 #6
0
static void
print_progress (CutConsoleUI *console, CutTestResultStatus status,
                gchar const *mark)
{
    print_with_color(console, status_to_color(status), "%s", mark);

    console->progress_row += strlen(mark);
    if (console->progress_row >= console->progress_row_max) {
        if (console->progress_row_max != -1 &&
            console->verbose_level < CUT_VERBOSE_LEVEL_VERBOSE)
            g_print("\n");
        console->progress_row = 0;
    }
}
예제 #7
0
static void
cb_error (CutRunContext *run_context, GError *error, CutConsoleUI *console)
{
    if (console->verbose_level >= CUT_VERBOSE_LEVEL_NORMAL) {
        print_with_color(console, status_to_color(CUT_TEST_RESULT_ERROR), "E");
        if (console->show_detail_immediately) {
            g_print("\n");
            print_error_detail(console, error);
        }
        fflush(stdout);
    }

    console->errors = g_list_append(console->errors, g_error_copy(error));
}
예제 #8
0
파일: printer.cpp 프로젝트: agatan/crepe
static void
print_file_name(std::ostream& os, std::string const& name) {
  if (!opt.group_result) return;
  print_with_color(os, opt.file_color, name);
  os << '\n';
}