[LTP] [PATCH v5 1/3] lib: adding .supported_archs field in tst_test structure

Li Wang liwang@redhat.com
Wed Nov 17 14:51:04 CET 2021


Hi Richard,


> > +const struct tst_arch tst_arch = {
> > +#if defined(__x86_64__)
> > +        .name = "x86_64",
>
> Writing out these string constants multiple times is error
> prone. Perhaps arch_type_list can be indexed with enum tst_arch_type and
> then name can be ".name = arch_type_list[TST_X86]"?
>

Right, that will more flexible but you know, all arches we have are just
those, and we write them only once in the LTP test library.

I slightly wanted to keep string constants to make it more simple/readable.


> > +static const char *const arch_type_list[] = {
> > +     "i386",
> > +     "i586",
> > +     "i686",
>
> These are not valid arch names AFAICT. There is no mapping from these to
> x86 in the tst_arch table above.
>
> Perhaps we could replace them all with x86?
>

Yes, that is also the unsure part I was concerned about in patch v4.
Because x86 is also an invalid arch (it is just a conventional name),
if we use it in the arch_type_list we have to recognize it as a valid arch
name in test case as well. I'm not sure that will be accepted by other
people.

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20211117/0be5e041/attachment.htm>


More information about the ltp mailing list