- skip = should_skip(m, i);
-
- if (skip) {
- skip:
- if (verbose && !streq(skip, "not relevant to target"))
- printf("%s: skipped (%s)\n", i->name, skip);
-
- /* If we're skipping this because a prereq failed, we fail:
- * count it as a score of 1. */
- if (i->skip_fail)
- (*running_total)++;
-
- list_del(&i->list);
- list_add_tail(&finished_tests, &i->list);
- list_for_each(&i->dependencies, d, node) {
- if (d->dependent->skip)
- continue;
- d->dependent->skip = "dependency was skipped";
- d->dependent->skip_fail = i->skip_fail;
+ /* We can see skipped things in two cases:
+ * (1) _info excluded them (presumably because they fail).
+ * (2) A prerequisite failed.
+ */
+ if (i->skip) {
+ if (verbose)
+ printf("%s%s: skipped (%s)\n",
+ run->prefix, i->name, i->skip);
+ /* Pass us up to the test which failed, not us. */
+ score->pass = true;
+ goto out;
+ }
+
+ if (i->can_run) {
+ i->skip = i->can_run(run->m);
+ if (i->skip) {
+ /* Test doesn't apply, or can't run? That's OK. */
+ if (verbose > 1)
+ printf("%s%s: skipped (%s)\n",
+ run->prefix, i->name, i->skip);
+ /* Mark our dependencies to skip. */
+ dgraph_traverse_from(&i->node, cannot_run, NULL);
+ score->pass = true;
+ score->total = 0;
+ goto out;