Merge branch 'tap-p-order' into 'master'

testing: Run tests specified with -p in the order specified

Closes #1763

See merge request GNOME/glib!805
This commit is contained in:
Emmanuele Bassi 2019-04-29 17:09:20 +00:00
commit 6d3dcd1a60
3 changed files with 11 additions and 8 deletions

View File

@ -1242,6 +1242,11 @@ parse_args (gint *argc_p,
exit (0);
}
}
/* We've been prepending to test_paths, but its order matters, so
* permute it */
test_paths = g_slist_reverse (test_paths);
/* collapse argv */
e = 1;
for (i = 1; i < argc; i++)

View File

@ -122,9 +122,9 @@ test_message (void)
(gchar*)argv0,
NULL,
"--GTestSubprocess",
"-p", "/glib/testing/protocol/debug",
"-p", "/glib/testing/protocol/message",
"-p", "/glib/testing/protocol/gtest-message",
"-p", "/glib/testing/protocol/message",
"-p", "/glib/testing/protocol/debug",
NULL
};
GTestLogBuffer* tlb;

View File

@ -1163,12 +1163,10 @@ test_tap (void)
NULL, NULL, &output, NULL, &status,
&error);
g_assert_no_error (error);
/* FIXME: Tests are run in an order that is the reverse of the order
* of -p options. */
g_assert_nonnull (strstr (output, "\nok 1 /b/a\n"));
g_assert_nonnull (strstr (output, "\nok 2 /b/b\n"));
g_assert_nonnull (strstr (output, "\nok 3 /c/a\n"));
g_assert_nonnull (strstr (output, "\nok 4 /c/a\n"));
g_assert_nonnull (strstr (output, "\nok 1 /c/a\n"));
g_assert_nonnull (strstr (output, "\nok 2 /c/a\n"));
g_assert_nonnull (strstr (output, "\nok 3 /b/a\n"));
g_assert_nonnull (strstr (output, "\nok 4 /b/b\n"));
g_assert_nonnull (strstr (output, "\n1..4\n"));
g_spawn_check_exit_status (status, &error);