Commit c3de8bca authored by Emmanuele Bassi's avatar Emmanuele Bassi

tests: Ensure we respect the TAP output format

When dumping the diff between the computed and expected results, we need
to respect the TAP format and place "#" in front of each line.
parent 984ed459
Pipeline #186650 failed with stages
in 1 minute and 25 seconds
......@@ -260,18 +260,27 @@ test_break (gconstpointer d)
diff = diff_with_file (expected_file, dump->str, dump->len, &error);
g_assert_no_error (error);
setlocale (LC_ALL, old_locale);
if (diff && diff[0])
{
char **lines = g_strsplit (diff, "\n", -1);
const char *line;
int i = 0;
g_test_message ("Contents don't match expected contents");
g_test_message ("%s", diff);
for (line = lines[0]; line != NULL; line = lines[++i])
g_test_message ("%s", line);
g_test_fail ();
g_strfreev (lines);
g_free (diff);
}
g_string_free (dump, TRUE);
g_free (expected_file);
setlocale (LC_ALL, old_locale);
}
int
......
......@@ -256,18 +256,27 @@ test_itemize (gconstpointer d)
diff = diff_with_file (expected_file, dump->str, dump->len, &error);
g_assert_no_error (error);
setlocale (LC_ALL, old_locale);
if (diff && diff[0])
{
char **lines = g_strsplit (diff, "\n", -1);
const char *line;
int i = 0;
g_test_message ("Contents don't match expected contents");
g_test_message ("%s", diff);
for (line = lines[0]; line != NULL; line = lines[++i])
g_test_message ("%s", line);
g_test_fail ();
g_strfreev (lines);
g_free (diff);
}
g_string_free (dump, TRUE);
g_free (expected_file);
setlocale (LC_ALL, old_locale);
}
int
......
......@@ -323,18 +323,26 @@ test_layout (gconstpointer d)
diff = diff_with_file (expected_file, dump->str, dump->len, &error);
g_assert_no_error (error);
setlocale (LC_ALL, old_locale);
if (diff && diff[0])
{
char **lines = g_strsplit (diff, "\n", -1);
const char *line;
int i = 0;
g_test_message ("Contents don't match expected contents");
g_test_message ("%s", diff);
for (line = lines[0]; line != NULL; line = lines[++i])
g_test_message ("%s", line);
g_test_fail ();
g_strfreev (lines);
g_free (diff);
}
g_string_free (dump, TRUE);
g_free (expected_file);
setlocale (LC_ALL, old_locale);
}
int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment