diff options
author | Andrea Canciani <ranma42@gmail.com> | 2010-08-06 18:20:49 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2010-10-07 23:09:13 +0200 |
commit | 4e064b3a32e4d699a6494bf9d8dbcd7b8d9cbc64 (patch) | |
tree | dca37dfe108e024dad4876855954cc3e65e5c93e /test/cairo-test-runner.c | |
parent | 5500d072e0e3d66d762a147caa803d036766b629 (diff) | |
download | cairo-4e064b3a32e4d699a6494bf9d8dbcd7b8d9cbc64.tar.gz |
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.
Diffstat (limited to 'test/cairo-test-runner.c')
-rw-r--r-- | test/cairo-test-runner.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c index 5aea64322..539817ef5 100644 --- a/test/cairo-test-runner.c +++ b/test/cairo-test-runner.c @@ -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; |