[LTP] [PATCH v2 1/2] library: add cmd check handler in needs_cmds

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Wed Dec 8 04:05:06 CET 2021


Hi Cyril
> Hi!
>> diff --git a/lib/tst_test.c b/lib/tst_test.c
>> index a79275722..7cca209ab 100644
>> --- a/lib/tst_test.c
>> +++ b/lib/tst_test.c
>
> I would rather put the version parsing code to a different source file
> than tst_test.c just because the tst_test.c is long enough already. What
> I did suggest for v1 is that the entry point function i.e.
> tst_check_cmd() now wouldn't get exported as a prototype to the tests by
> being defined in a header included in the tst_test.h header.
>
> We already have include/tst_private.h that is expected to be used for
> function prototypes that are not supposed to be available to the test
> code.
>
Now, I understand. so I can just move tst_check_cmd declaration into 
tst_private.h and then tst_test.c included it.

But the source code should move into where, it has two choices:
1) like v1, move a new lib source file ie tst_version_parser.c
2) since it is related to cmd, we can move it into lib/tst_cmd.c


I prefer to use 2nd way. What do you think about this?

Best Regards
Yang Xu
> Other than this the code looks good.
>


More information about the ltp mailing list