tests: --list lists individual fixture setups

When there is a fixture setup array, list all fixture setups with their
numbers and names. This should help people picking a single fixture to
run and makes the --list output more interesting.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2021-02-15 16:14:44 +02:00 committed by Pekka Paalanen
parent d91e63dea0
commit 3ee1f27278

View File

@ -174,11 +174,21 @@ list_tests(void)
{
const struct fixture_setup_array *fsa;
const struct weston_test_entry *t;
int i;
fsa = fixture_setup_array_get_();
printf("Fixture setups: %d\n", fsa->n_elements);
if (fsa->n_elements > 1) {
printf("Fixture setups:\n");
for (i = 0; i < fsa->n_elements; i++) {
printf("%2d: %s\n", i + 1,
fixture_setup_array_get_name(fsa, i));
}
} else {
printf("One fixture setup.\n");
}
printf("Test names:\n");
for (t = &__start_test_section; t < &__stop_test_section; t++) {
printf(" %s\n", t->name);
if (t->n_elements > 1)