check: fix excluding test groups
authorAmir Goldstein <amir73il@gmail.com>
Fri, 9 Dec 2016 08:50:46 +0000 (10:50 +0200)
committerEryu Guan <eguan@redhat.com>
Mon, 12 Dec 2016 04:50:37 +0000 (12:50 +0800)
commit2257d91fe4a5b018c02cb06e0a4b62ae094e494f
tree64d2cc3d3740c23c0c3ec46c3acb3d4a20f3f291
parente6111674ea185d8e77f3879ca91cdb61208c9e2e
check: fix excluding test groups

The -x flag is used to exclude tests that belong to
certain groups from the test args list.

When the test args list is expressed as a match pattern,
-x fails to exclude the tests that match the pattern
and belong to excluded groups.

For example:
$ ./check -n xfs/??? | wc -l
341
$ ./check -n -x fuzzers,dangerous_fuzzers xfs/??? | wc -l
341

After the fix:
$ ./check -n -x fuzzers,dangerous_fuzzers xfs/??? | wc -l
315

This bug seems to date back to this git repo epoc.

The fix also sorts out filtering of test that are not found
in group files for the patten match input.

For example:
$ ./check xfs/001*
...
xfs/001  2s
xfs/001.out  [failed, exit status 127] - no qualified output

After the fix:
$ ./check -n xfs/001*
xfs/001.out - unknown test, ignored
...
xfs/001 2s

[eguan: use grep -q and fix if-then-fi style]

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
check