Problem
--filter explains itself when it selects nothing (#1237). --tag does not:
$ bashunit --tag integraton t_test.sh
No tests found
Tags are worse off than filters. A filter matches a test function name, and those are visible in any normal run, so a typo is recoverable by looking at the output. A tag is a user-defined string that appears only in # @tag comments, and nothing lists them — there is no --list-tags, and --list --list-format json only reports the tags of tests it selected, which is empty precisely when you need them.
So a typo'd tag leaves the reader with no way to discover the right one short of grepping the suite.
Proposal
Name the tags the run actually saw:
No test matches tag 'integraton'. Tags in the selected files: integration,slow.
and when no test carries one at all, say that instead — it is a different mistake:
No test matches tag 'anything'. No test in the selected files carries a '# @tag'.
The tags map is cached per script, so only the last file's survives to the summary; accumulating the names as each file is scanned is per file, not per test, and costs no fork. The hint only prints on a run that already selected nothing.
Problem
--filterexplains itself when it selects nothing (#1237).--tagdoes not:Tags are worse off than filters. A filter matches a test function name, and those are visible in any normal run, so a typo is recoverable by looking at the output. A tag is a user-defined string that appears only in
# @tagcomments, and nothing lists them — there is no--list-tags, and--list --list-format jsononly reports the tags of tests it selected, which is empty precisely when you need them.So a typo'd tag leaves the reader with no way to discover the right one short of grepping the suite.
Proposal
Name the tags the run actually saw:
and when no test carries one at all, say that instead — it is a different mistake:
The tags map is cached per script, so only the last file's survives to the summary; accumulating the names as each file is scanned is per file, not per test, and costs no fork. The hint only prints on a run that already selected nothing.