diff options
author | Derek Morton <derek.j.morton@intel.com> | 2016-02-04 12:06:57 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-02-17 18:21:12 +0100 |
commit | ef724ab2bba7a51113542c0bc9e77d34e8935c60 (patch) | |
tree | 5ce7c5095e9a4679e0966f2c71beef18e03efc9c /lib/igt_core.c | |
parent | 0a45d6ba1371bb879f55d9f75d893552c2f71c97 (diff) |
lib/igt_core.c: Expand --run-subtest functionality.
Added extended wildcard support when specifying --run-subtest.
Wildcard format is as specified in rfc3977 and the uwildmat() implementation
is taken from libinn.
See https://tools.ietf.org/html/rfc3977#section-4 for a description of
allowed wildcard expressions.
v2: Use comma as list separator (Ville Syrjala)
support both ^ and ! as not operators (Dave Gordon)
v3: Updated to use uwildmat() (Dave Gordon)
Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[danvet: Fixup whitespace. Add #include <stdint.h>. Run lint.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_core.c')
-rw-r--r-- | lib/igt_core.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/igt_core.c b/lib/igt_core.c index 6b69bb78..8e0bd2e8 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -56,7 +56,7 @@ #include <ctype.h> #include <limits.h> #include <locale.h> -#include <fnmatch.h> +#include <uwildmat/uwildmat.h> #include "drmtest.h" #include "intel_chipset.h" @@ -209,6 +209,19 @@ * intel gpu to be present). Then individual subtests can be run with * "--run-subtest". Usage help for tests with subtests can be obtained with the * "--help" command line option. + * + * A wildcard expression can be given to --run-subtest to specify a subset of + * subtests to run. See https://tools.ietf.org/html/rfc3977#section-4 for a + * description of allowed wildcard expressions. + * Some examples of allowed wildcard expressions are: + * + * - '*basic*' match any subtest containing basic + * - 'basic-???' match any subtest named basic- with 3 characters after - + * - 'basic-[0-9]' match any subtest named basic- with a single number after - + * - 'basic-[^0-9]' match any subtest named basic- with a single non numerical character after - + * - 'basic*,advanced*' match any subtest starting basic or advanced + * - '*,!basic*' match any subtest not starting basic + * - 'basic*,!basic-render*' match any subtest starting basic but not starting basic-render */ static unsigned int exit_handler_count; @@ -814,7 +827,7 @@ bool __igt_run_subtest(const char *subtest_name) } if (run_single_subtest) { - if (fnmatch(run_single_subtest, subtest_name, 0) != 0) + if (uwildmat(subtest_name, run_single_subtest) == 0) return false; else run_single_subtest_found = true; |