mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-06 08:08:04 +02:00
[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:
parent
ac56371550
commit
844c809698
1 changed files with 14 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue