test: Make tests run in natural order

When tests are registered, they are prepended to a list.
Reverting the list, we get a list whose order is the same as that
of registration.
This commit is contained in:
Andrea Canciani 2010-08-06 18:20:49 +02:00
parent 5500d072e0
commit 4e064b3a32

View file

@ -125,6 +125,18 @@ _log (cairo_test_context_t *ctx,
va_end (ap);
}
static void
_tests_reverse ()
{
cairo_test_t *list, *next;
for (list = tests, tests = NULL; list != NULL; list = next) {
next = list->next;
list->next = tests;
tests = list;
}
}
static cairo_test_list_t *
_list_prepend (cairo_test_list_t *head, const cairo_test_t *test)
{
@ -705,6 +717,7 @@ main (int argc, char **argv)
#endif
_cairo_test_runner_register_tests ();
_tests_reverse ();
memset (&runner, 0, sizeof (runner));
runner.num_device_offsets = 1;