[CMake] Running test who have two labels?

Eric Noulard eric.noulard at gmail.com
Fri Mar 24 08:08:20 EDT 2017


2017-03-24 12:30 GMT+01:00 Nils Gladitz <nilsgladitz at gmail.com>:

> On 03/24/2017 11:50 AM, Eric Noulard wrote:
>
> Hi there,
>>
>> I'm playing with ctest LABELS and I wanted to know whether if it is
>> possible
>> to run the set of tests which have 2 labels ?
>>
>> I manage to have all tests which have **either** L1 or L2:
>>
>> ctest -L "L1|L2"
>>
>> but how can I write a proper command line for both L1 and L2 ?
>>
>> apparently
>>
>> ctest -L "L1" -L "L2"
>>
>> only takes into account the last -L argument.
>>
>>
> I don't think it is possible currently.
> To a degree you might be able to work around it by creating additional
> labels that combine the existing ones e.g. "L1", "L2", "L1-L2".
>

Yes of course.
I do test name mangling but I was hoping for more "classifying" feature
with labels and was expecting a simple
OR and AND operation with labels. This is not the case.



>
> I was pondering trying to implement test filtering based on the condition
> evaluator CMake uses for if()/while() at some point
> (cmConditionEvaluator.cxx).
> e.g. --run-tests-if "L1 IN_LIST TEST_LABELS AND L2 IN_LIST TEST_LABELS"


It could have been nice but may be overkill my needs.
A repetable ANDing -L or -LE will do the job.

That said since test filtering is regex-based I simply rediscovered that
ANDing or negating regex is not easy.

-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170324/98c5ec79/attachment.html>


More information about the CMake mailing list