[LTP] [RFC] Remove [Description] subtitle from docparse
Petr Vorel
pvorel@suse.cz
Fri Jan 31 12:50:46 CET 2025
> Hi!
> > Can we remove [Description] part from docparse documentation in tests?
> > This is transformed into "Description" subtitle in resulted html/pdf.
> > 1) It's not really needed (it's obvious that it's a description of the test)
> > 2) Sometimes it's missing (inconsistency).
> That part can be fixed with something as:
> diff --git a/metadata/metaparse.c b/metadata/metaparse.c
> index 2b96149dc..422604a2c 100644
> --- a/metadata/metaparse.c
> +++ b/metadata/metaparse.c
> @@ -852,6 +852,14 @@ static struct data_node *parse_file(const char *fname)
> if (data_node_array_len(doc)) {
> data_node_hash_add(res, "doc", doc);
> +
> + char *str = doc->array.array[0]->string.val;
> +
> + if (!strstr("[Description]", str)) {
> + fprintf(stderr, "%s: Missing [Description] in doc comment!\n", fname);
> + exit(1);
> + }
> +
> found = 1;
> } else {
> data_node_free(doc);
Sure, that could work as well.
> > I would keep other subtitles (e.g. [Algorithm]), just remove the first one.
> I find it a bit inconsistent if we do it this way, but I guess either
> way is fine.
The reason why suggested to remove it is that I don't see much information value
in "Description" title. "Algorithm" has at least little bit of information value.
Besides these two we have only:
* [Prerequisites] (testcases/kernel/mem/ksm/ksm07.c)
* [Race Description] (testcases/kernel/syscalls/fork/fork13.c)
Kind regards,
Petr
More information about the ltp
mailing list