All of lore.kernel.org
 help / color / mirror / Atom feed
* [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

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.