- for (i = 0; i < d->num_lines; i++)
- btree_insert(info_exclude, strip(info, d->lines[i]));
- break;
+ for (i = 0; i < d->num_lines; i++) {
+ char **words = collapse(strsplit(d, d->lines[i], " \t",
+ NULL), NULL);
+ if (!words[0])
+ continue;
+
+ if (strncmp(words[0], "//", 2) == 0)
+ continue;
+
+ test = find_test(words[0]);
+ if (!test) {
+ warnx("%s: unknown ccanlint test '%s'",
+ info->fullname, words[0]);
+ continue;
+ }
+
+ if (!words[1]) {
+ warnx("%s: no argument to test '%s'",
+ info->fullname, words[0]);
+ continue;
+ }
+
+ /* Known failure? */
+ if (strcasecmp(words[1], "FAIL") == 0) {
+ if (mark_fails)
+ btree_insert(info_exclude, words[0]);
+ } else {
+ if (!test->takes_options)
+ warnx("%s: %s doesn't take options",
+ info->fullname, words[0]);
+ /* Copy line exactly into options. */
+ test->options = strstr(d->lines[i], words[0])
+ + strlen(words[0]);
+ }
+ }