diff mbox

[i-g-t] lib/igt_core.c: Add partial match functionality to run-subtests

Message ID 1455877891-25291-1-git-send-email-derek.j.morton@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Derek Morton Feb. 19, 2016, 10:31 a.m. UTC
Add the ability to specify a substring of the subtest using --run-subtests.

This allows 'string' to be used as an abbreviation of the wildcard expression
'*string*' when defining which subtests should run.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
---
 lib/igt_core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 8e0bd2e..1e31a25 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -215,7 +215,7 @@ 
  * description of allowed wildcard expressions.
  * Some examples of allowed wildcard expressions are:
  *
- * - '*basic*' match any subtest containing basic
+ * - '*basic*' match any subtest containing basic. This expression may be abbreviated to just '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 -
@@ -827,7 +827,8 @@  bool __igt_run_subtest(const char *subtest_name)
 	}
 
 	if (run_single_subtest) {
-		if (uwildmat(subtest_name, run_single_subtest) == 0)
+		if ((uwildmat(subtest_name, run_single_subtest) == 0) &&
+		    (NULL == strstr(subtest_name, run_single_subtest)))
 			return false;
 		else
 			run_single_subtest_found = true;