Пример #1
0
void
cut_setup (void)
{
    run_test_flag = FALSE;
    n_setup_calls = 0;
    n_teardown_calls = 0;
    n_tests = 0;
    n_start_signals = 0;
    n_complete_signals = 0;
    n_success_signals = 0;
    n_failure_signals = 0;
    n_error_signals = 0;
    n_pending_signals = 0;
    n_notification_signals = 0;
    n_pass_assertion_signals = 0;
    n_omission_signals = 0;

    run_context = CUT_RUN_CONTEXT(cut_test_runner_new());
    test_case = cut_test_case_new("driver test case",
                                  stub_setup, stub_teardown,
                                  NULL, NULL);
    test_iterator = NULL;

    fail_line = 0;
}
Пример #2
0
static void
set_property (GObject      *object,
              guint         prop_id,
              const GValue *value,
              GParamSpec   *pspec)
{
    CutXMLStream *stream = CUT_XML_STREAM(object);

    switch (prop_id) {
      case PROP_RUN_CONTEXT:
        attach_to_run_context(CUT_LISTENER(stream),
                              CUT_RUN_CONTEXT(g_value_get_object(value)));
        break;
      case PROP_STREAM_FUNCTION:
        stream->stream_function = g_value_get_pointer(value);
        break;
      case PROP_STREAM_FUNCTION_USER_DATA:
        stream->stream_function_user_data = g_value_get_pointer(value);
        break;
      case PROP_STREAM_FUNCTION_USER_DATA_DESTROY_FUNCTION:
        stream->stream_function_user_data_destroy_function =
            g_value_get_pointer(value);
        break;
      default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}
Пример #3
0
gboolean
cut_test_runner_run_test_suite (CutTestRunner *runner, CutTestSuite *test_suite)
{
    CutRunContext *context;

    context = CUT_RUN_CONTEXT(runner);
    connect_to_test_suite(context, test_suite);
    return cut_test_suite_run(test_suite, context);
}
Пример #4
0
gboolean
cut_test_runner_run_test (CutTestRunner *runner, CutTest *test,
                          CutTestContext *test_context)
{
    CutRunContext *context;

    context = CUT_RUN_CONTEXT(runner);
    connect_to_test(context, test);
    return cut_test_run(test, test_context, context);
}
Пример #5
0
gboolean
cut_test_runner_run_test_iterator (CutTestRunner *runner,
                                   CutTestIterator *test_iterator,
                                   CutTestContext *test_context)
{
    CutRunContext *context;

    context = CUT_RUN_CONTEXT(runner);
    connect_to_test_iterator(context, test_iterator);
    return cut_test_run(CUT_TEST(test_iterator), test_context, context);
}
Пример #6
0
static gboolean
runner_run (CutRunner *runner)
{
    CutRunContext *context;
    CutTestSuite *suite;
    gboolean success;

    context = CUT_RUN_CONTEXT(runner);
    suite = cut_run_context_get_test_suite(context);
    g_signal_emit_by_name(context, "start-run");
    success = cut_test_runner_run_test_suite(CUT_TEST_RUNNER(runner), suite);
    success = cut_run_context_emit_complete_run(context, success);
    return success;
}
Пример #7
0
static gboolean
run (void)
{
    gboolean success;

    run_context = CUT_RUN_CONTEXT(cut_test_runner_new());

    test_context = cut_test_context_new(run_context, NULL, NULL, NULL, test);
    cut_test_context_current_push(test_context);
    success = cut_test_runner_run_test(CUT_TEST_RUNNER(run_context),
                                       test, test_context);
    cut_test_context_current_pop();

    return success;
}
Пример #8
0
void
cut_setup (void)
{
    const gchar *test_names[] = {"/.*/", NULL};
    test = NULL;
    test_context = NULL;

    run_context = CUT_RUN_CONTEXT(cut_test_runner_new());
    cut_run_context_set_target_test_names(run_context, test_names);

    report = cut_report_new("xml", NULL);
    cut_listener_attach_to_run_context(CUT_LISTENER(report), run_context);

    test_case = cut_test_case_new("stub test case",
                                  NULL, NULL, NULL, NULL);
}
Пример #9
0
static void
set_property (GObject      *object,
              guint         prop_id,
              const GValue *value,
              GParamSpec   *pspec)
{
    CutPDFReport *report = CUT_PDF_REPORT(object);

    switch (prop_id) {
      case PROP_RUN_CONTEXT:
        attach_to_run_context(CUT_LISTENER(report), CUT_RUN_CONTEXT(g_value_get_object(value)));
        break;
      default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
        break;
    }
}