* [LTP] [PATCH] metaparse: ignore macros in tst_test structure parsing
@ 2025-05-05 15:12 Cyril Hrubis
2025-05-05 19:58 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2025-05-05 15:12 UTC (permalink / raw)
To: ltp
All we need to do is to drop all lines starting with '#'.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
This is needed on the top of:
http://patchwork.ozlabs.org/project/ltp/patch/20250429135542.19680-1-chrubis@suse.cz/
In order to produce a proper metadata JSON.
metadata/metaparse.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/metadata/metaparse.c b/metadata/metaparse.c
index 2b96149dc..9723a92c2 100644
--- a/metadata/metaparse.c
+++ b/metadata/metaparse.c
@@ -25,7 +25,7 @@ static char *includepath;
#define WARN(str) fprintf(stderr, "WARNING: " str "\n")
-static void oneline_comment(FILE *f)
+static void remove_to_newline(FILE *f)
{
int c;
@@ -126,7 +126,7 @@ static void maybe_comment(FILE *f, struct data_node *doc)
switch (c) {
case '/':
- oneline_comment(f);
+ remove_to_newline(f);
break;
case '*':
maybe_doc_comment(f, doc);
@@ -571,6 +571,11 @@ static int parse_test_struct(FILE *f, struct data_node *doc, struct data_node *n
if (!strcmp(token, "}"))
return 0;
+ if (!strcmp(token, "#")) {
+ remove_to_newline(f);
+ continue;
+ }
+
switch (state) {
case 0:
id = strdup(token);
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-06 9:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-05 15:12 [LTP] [PATCH] metaparse: ignore macros in tst_test structure parsing Cyril Hrubis
2025-05-05 19:58 ` Petr Vorel
2025-05-06 9:43 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.