diff options
author | Simon McVittie <smcv@debian.org> | 2019-10-06 16:44:15 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2019-10-10 17:14:19 +0100 |
commit | 5f9c7de38527e0df9822a1ba116186869811d7ba (patch) | |
tree | 1d25faf8ccd3105e5376ee4a705349139a8798b9 | |
parent | b8b8c30853b3c129dbe03b976f46980be6b59369 (diff) | |
download | libsoup-5f9c7de38527e0df9822a1ba116186869811d7ba.tar.gz |
xmlrpc tests: Cope with GLib 2.62 TAP output
In GLib 2.62, "some-test-executable -l" outputs TAP headers before the
list of tests. Ignore those lines. Otherwise, the assertion immediately
below will fail, leading to test failure with a message like:
ERROR:../tests/xmlrpc-server-test.c:347:main: 'g_str_has_prefix (tests[i], "/xmlrpc/")' should be TRUE
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r-- | tests/xmlrpc-old-server-test.c | 7 | ||||
-rw-r--r-- | tests/xmlrpc-server-test.c | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/xmlrpc-old-server-test.c b/tests/xmlrpc-old-server-test.c index a7076b5a..977c5379 100644 --- a/tests/xmlrpc-old-server-test.c +++ b/tests/xmlrpc-old-server-test.c @@ -344,6 +344,13 @@ main (int argc, char **argv) g_free (out); for (i = 0; tests[i] && *tests[i]; i++) { + /* GLib >= 2.62 defaults to TAP output for tests, and + * this adds TAP diagnostics "#..." and the test count + * "1..N", even in the output of "some-test -l". + * Ignore those. */ + if (tests[i][0] == '#' || g_str_has_prefix (tests[i], "1..")) + continue; + g_assert_true (g_str_has_prefix (tests[i], "/xmlrpc-old/")); path = g_strdup_printf ("/xmlrpc-old-server/%s", tests[i] + strlen ("/xmlrpc-old/")); g_test_add_data_func (path, tests[i], do_one_xmlrpc_test); diff --git a/tests/xmlrpc-server-test.c b/tests/xmlrpc-server-test.c index 80f04ea8..a6d4abd5 100644 --- a/tests/xmlrpc-server-test.c +++ b/tests/xmlrpc-server-test.c @@ -344,6 +344,13 @@ main (int argc, char **argv) g_free (out); for (i = 0; tests[i] && *tests[i]; i++) { + /* GLib >= 2.62 defaults to TAP output for tests, and + * this adds TAP diagnostics "#..." and the test count + * "1..N", even in the output of "some-test -l". + * Ignore those. */ + if (tests[i][0] == '#' || g_str_has_prefix (tests[i], "1..")) + continue; + g_assert_true (g_str_has_prefix (tests[i], "/xmlrpc/")); path = g_strdup_printf ("/xmlrpc-server/%s", tests[i] + strlen ("/xmlrpc/")); g_test_add_data_func (path, tests[i], do_one_xmlrpc_test); |