Re: [PATCH v5 5/6] tests: Allow comma separate list of libs to preload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 05/20/2016 09:03 AM, Peter Krempa wrote:
> On Thu, May 19, 2016 at 16:29:04 -0400, John Ferlan wrote:
>> Adjust the model to allow callers to provide a comma separated list
>> of libraries to be loaded. For those tests that may need more than
>> one mock library loaded.
>>
>> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
>> ---
>>  tests/testutils.c | 12 ++++++++++--
>>  1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/testutils.c b/tests/testutils.c
>> index 9180e86..69cd77c 100644
>> --- a/tests/testutils.c
>> +++ b/tests/testutils.c
>> @@ -854,8 +854,16 @@ int virtTestMain(int argc,
>>      if (getenv("VIR_TEST_FILE_ACCESS"))
>>          VIRT_TEST_PRELOAD(TEST_MOCK);
>>  
>> -    if (lib)
>> -        VIRT_TEST_PRELOAD(lib);
>> +    if (lib) {
>> +        char **liblist;
>> +        size_t count = 0;
>> +        size_t i;
>> +
>> +        liblist = virStringSplitCount(lib, ",", 0, &count);
>> +        for (i = 0; i < count; i++)
>> +            VIRT_TEST_PRELOAD(liblist[i]);
> 
> I don't like this very much. I'll try to refactor the chaining of the
> mocking libs to prevent re-execing for every single .so you want to
> pre-load.
> 
> I expect to use a variadic macro for that.
> 

OK - I'll wait for that before pushing patch 6 since it depends on it.

John

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]