From 3fb241d4d627db00acfe83b889f1e3f2be8566b8 Mon Sep 17 00:00:00 2001 From: Shaun Ren Date: Wed, 22 Jan 2025 21:25:56 -0500 Subject: [PATCH] tests/shader_runner: Support the negation of tag matches. --- tests/shader_runner.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 78d831e3..a8103c0c 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -187,17 +187,27 @@ static bool check_qualifier_args_conjunction(struct shader_runner *runner, } else { + bool negate = false; + + if (*line == '!') + { + negate = true; + ++line; + } + for (unsigned int i = 0; i < ARRAY_SIZE(valid_tags); ++i) { const char *option_text = valid_tags[i]; size_t option_len = strlen(option_text); + bool tag_match; if (strncmp(line, option_text, option_len)) continue; match = true; line += option_len; - holds &= match_tag(runner, option_text); + tag_match = match_tag(runner, option_text); + holds &= negate ? !tag_match : tag_match; break; } }