* [LTP] [PATCH 1/1] metaparse: Add "api" to JSON
@ 2025-02-12 15:37 Petr Vorel
2025-02-12 15:43 ` Petr Vorel
2025-02-12 15:46 ` Cyril Hrubis
0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2025-02-12 15:37 UTC (permalink / raw)
To: ltp
metaparse.c prints api: "c"
metaparse-sh.c prints api: "shell"
This is important for the sphinx (readthedoc) test catalog, which will
generate links to C API and shell API (links will be different).
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,
a follow up to Cyrils shell test parser (metadata-sh.c)
https://patchwork.ozlabs.org/project/ltp/patch/20250212131618.6810-2-chrubis@suse.cz/
Kind regards,
Petr
metadata/metaparse-sh.c | 1 +
metadata/metaparse.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/metadata/metaparse-sh.c b/metadata/metaparse-sh.c
index 9eb38f5834..5d1cf0765a 100644
--- a/metadata/metaparse-sh.c
+++ b/metadata/metaparse-sh.c
@@ -26,6 +26,7 @@ static void json_finish(const char *path)
if (!started)
return;
+ printf(" \"api\": \"shell\",\n");
printf(" \"fname\": \"%s\"\n", path);
printf(" }");
}
diff --git a/metadata/metaparse.c b/metadata/metaparse.c
index 2b96149dcb..0cfe51cc1d 100644
--- a/metadata/metaparse.c
+++ b/metadata/metaparse.c
@@ -1036,9 +1036,12 @@ int main(int argc, char *argv[])
}
}
+ data_node_hash_add(res, "api", data_node_string("c"));
+
data_node_hash_add(res, "fname", data_node_string(argv[optind]));
printf(" \"%s\": ", strip_name(argv[optind]));
data_to_json(res, stdout, 2);
+
data_node_free(res);
return 0;
--
2.47.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] metaparse: Add "api" to JSON
2025-02-12 15:37 [LTP] [PATCH 1/1] metaparse: Add "api" to JSON Petr Vorel
@ 2025-02-12 15:43 ` Petr Vorel
2025-02-12 15:46 ` Cyril Hrubis
1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2025-02-12 15:43 UTC (permalink / raw)
To: ltp
Hi Cyril, Andrea,
> metaparse.c prints api: "c"
> metaparse-sh.c prints api: "shell"
> This is important for the sphinx (readthedoc) test catalog, which will
> generate links to C API and shell API (links will be different).
Ah, "api" needs to be filtered out in doc/conf.py. It will be used in the code,
not presented.
Kind regards,
Petr
diff --git doc/conf.py doc/conf.py
index 0bebd0e242..22f272ad59 100644
--- doc/conf.py
+++ doc/conf.py
@@ -361,6 +361,7 @@ def _generate_setup_table(keys):
'fname',
'doc',
# following keys don't need to be shown
+ 'api',
'child_needs_reinit',
'needs_checkpoints',
'forks_child',
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] metaparse: Add "api" to JSON
2025-02-12 15:37 [LTP] [PATCH 1/1] metaparse: Add "api" to JSON Petr Vorel
2025-02-12 15:43 ` Petr Vorel
@ 2025-02-12 15:46 ` Cyril Hrubis
2025-02-12 16:25 ` Petr Vorel
1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2025-02-12 15:46 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi!
Do we really need this?
The C test names are plain and the shell test names end with .sh that is
intentional.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH 1/1] metaparse: Add "api" to JSON
2025-02-12 15:46 ` Cyril Hrubis
@ 2025-02-12 16:25 ` Petr Vorel
0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2025-02-12 16:25 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: ltp
> Hi!
> Do we really need this?
> The C test names are plain and the shell test names end with .sh that is
> intentional.
OK, I'll parse fname.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-12 16:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 15:37 [LTP] [PATCH 1/1] metaparse: Add "api" to JSON Petr Vorel
2025-02-12 15:43 ` Petr Vorel
2025-02-12 15:46 ` Cyril Hrubis
2025-02-12 16:25 ` Petr Vorel
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.