[tracker/wip/carlosg/junit: 63/71] tests: Make test output respect TAP protocol format




commit eddac0b7fde0c1705c10f20ff6e5db0ba62c0554
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Dec 10 16:51:09 2020 +0100

    tests: Make test output respect TAP protocol format
    
    These tests mess with stdout in ways that break the TAP format. Let
    them print stuff in a way that is ignored there, or just don't do
    that.

 tests/libtracker-data/tracker-insert-or-replace-test.c | 12 ------------
 tests/libtracker-sparql/tracker-sparql-test.c          |  6 +++---
 2 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/tests/libtracker-data/tracker-insert-or-replace-test.c 
b/tests/libtracker-data/tracker-insert-or-replace-test.c
index ad6f40721..28d30a7de 100644
--- a/tests/libtracker-data/tracker-insert-or-replace-test.c
+++ b/tests/libtracker-data/tracker-insert-or-replace-test.c
@@ -134,7 +134,6 @@ main (int argc, char *argv[])
        gchar *test_data_dir;
        gchar *query;
        gint i;
-       GTimer *timer;
 
        test_data_dir = g_build_filename (g_get_tmp_dir (),
                                          "insert-or-replace-test-data-XXXXXX",
@@ -149,8 +148,6 @@ main (int argc, char *argv[])
        g_initable_init (G_INITABLE (manager), NULL, &error);
        g_assert_no_error (error);
 
-       timer = g_timer_new ();
-
        for (i = 0; i < N_QUERIES; i++) {
                query = g_strdup_printf (insert_query_replace,
                                         i, i, i, i, i, i, i, i, i , i, i, i, i);
@@ -160,11 +157,6 @@ main (int argc, char *argv[])
                g_free (query);
        }
 
-       g_print ("REPLACE  : %u contacts: %f\n",
-                N_QUERIES, g_timer_elapsed (timer, NULL));
-       g_timer_destroy (timer);
-       timer = g_timer_new ();
-
        for (i = 0; i < N_QUERIES; i++) {
                query = g_strdup_printf (insert_query_original,
                                         i, i, i, i, i, i, i, i, i, i, i, i, i, i, i);
@@ -174,10 +166,6 @@ main (int argc, char *argv[])
                g_free (query);
        }
 
-       g_print ("ORIGINAL : %u contacts: %f\n", N_QUERIES,
-                g_timer_elapsed (timer, NULL));
-       g_timer_destroy (timer);
-
        g_object_unref (manager);
        g_object_unref (cache);
        g_object_unref (ontology);
diff --git a/tests/libtracker-sparql/tracker-sparql-test.c b/tests/libtracker-sparql/tracker-sparql-test.c
index ec831cb12..5e8730bcd 100644
--- a/tests/libtracker-sparql/tracker-sparql-test.c
+++ b/tests/libtracker-sparql/tracker-sparql-test.c
@@ -126,7 +126,7 @@ test_tracker_sparql_cursor_next_async_cb (GObject      *source,
 
        if (finished == 1 && next == next_to_cancel) {
                g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED);
-               g_print ("Got Cancellation GError\n");
+               g_print ("# Got Cancellation GError\n");
        } else {
                g_assert_no_error (error);
        }
@@ -153,7 +153,7 @@ test_tracker_sparql_cursor_next_async_cb (GObject      *source,
                 */
                if (next == next_to_cancel && finished == 1) {
                        /* Cancel */
-                       g_print ("Cancelling cancellable:%p at count:%d\n",
+                       g_print ("# Cancelling cancellable:%p at count:%d\n",
                                 cancellables[query],
                                 next);
                        g_cancellable_cancel (cancellables[query]);
@@ -174,7 +174,7 @@ test_tracker_sparql_cursor_next_async_query (TrackerSparqlConnection *connection
        GError *error = NULL;
 
        g_assert_true (query < G_N_ELEMENTS (queries));
-       g_print ("ASYNC query %d starting:\n", query);
+       g_print ("# ASYNC query %d starting:\n", query);
 
        cancellables[query] = g_cancellable_new ();
        g_assert_true (cancellables[query] != NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]