[igt-dev] [PATCH i-g-t] igt: Allow ':' in subtest names
Chris Wilson
chris at chris-wilson.co.uk
Sat Apr 11 12:24:53 UTC 2020
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala at intel.com>
---
lib/igt_core.c | 8 +++++---
runner/resultgen.c | 5 ++++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 778624984..ca3e26c64 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -1179,10 +1179,12 @@ static bool valid_name_for_subtest(const char *subtest_name)
{
int i;
- /* check the subtest name only contains a-z, A-Z, 0-9, '-' and '_' */
+ /* check the subtest name only contains a-z, A-Z, 0-9, [-_:] */
for (i = 0; subtest_name[i] != '\0'; i++)
- if (subtest_name[i] != '_' && subtest_name[i] != '-'
- && !isalnum(subtest_name[i]))
+ if (subtest_name[i] != '_' &&
+ subtest_name[i] != '-' &&
+ subtest_name[i] != ':' &&
+ !isalnum(subtest_name[i]))
return false;
return true;
diff --git a/runner/resultgen.c b/runner/resultgen.c
index fe59aafeb..3a05917b3 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -369,7 +369,7 @@ static struct matches find_matches(const char *buf, const char *bufend,
static bool valid_char_for_subtest_name(char x)
{
- return x == '-' || x == '_' || isalnum(x);
+ return x == '-' || x == '_' || x == ':' || isalnum(x);
}
static bool is_subtest_result_line(const char *needle, const char *line, const char *bufend)
@@ -391,6 +391,9 @@ static bool is_subtest_result_line(const char *needle, const char *line, const c
while (line < bufend && valid_char_for_subtest_name(*line))
line++;
+ if (line[-1] == ':')
+ line--;
+
if (line >= bufend || *line++ != ':')
return false;
--
2.26.0
More information about the igt-dev
mailing list