[boilerplate] Print out known targets on error.

Improve the 'Cannot find target ...' error message for an incorrect
CAIRO_TEST_TARGET by actually listing the targets that have been compiled
into the test suite.
This commit is contained in:
Chris Wilson 2009-06-09 12:45:53 +01:00
parent ac56371550
commit 844c809698

View file

@ -781,7 +781,20 @@ cairo_boilerplate_get_targets (int *pnum_targets, cairo_bool_t *plimited_targets
}
if (!found) {
fprintf (stderr, "Cannot find target '%.*s'\n", (int)(end - tname), tname);
fprintf (stderr, "Cannot find target '%.*s'.\n",
(int)(end - tname), tname);
fprintf (stderr, "Known targets:");
for (i = 0; i < sizeof (targets) / sizeof (targets[0]); i++) {
if (i != 0) {
if (strcmp (targets[i].name, targets[i-1].name) == 0) {
/* filter out repeats that differ in content */
continue;
}
fprintf (stderr, ",");
}
fprintf (stderr, " %s", targets[i].name);
}
fprintf (stderr, "\n");
exit(-1);
}