[Lldb-commits] [lldb] r253623 - Make skipIf support the not_in function.

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 20 10:15:08 PST 2015


OK, I think this works now.  I tested it a few different ways.  I'll commit
momentarily.

Thanks.

On Thu, Nov 19, 2015 at 6:16 PM, Zachary Turner <zturner at google.com> wrote:

> Adrian:
>
> I think the check_list_or_lambda function needs to be renamed to
> `check_decorator_attribute`, and it needs to handle values that are neither
> lists nor functions.  i.e. it needs to handle single values.  So I believe
> right now check_list_or_lambda does something like this:
>
> def check_list_or_lambda(list_or_lambda, value):
>     if six.callable(list_or_lambda):
>         return list_or_lambda(value)
>     else:
>         return list_or_lambda is None or value in list_or_lambda
>
> and maybe it needs to look more like this:
>
> def check_decorator_attribute(item, value):
>     if attr is None:
>         return True
>     if six.callable(item):
>         return item(value)
>     elif isinstance(item, (list, tuple)):
>         return value in attr
>     else:
>         return value == attr
>
> On Thu, Nov 19, 2015 at 5:29 PM Siva Chandra via lldb-commits <
> lldb-commits at lists.llvm.org> wrote:
>
>> This make the test TestVectorTypesFormatting, which is annotated with
>> @skipIf(compiler='gcc'), run when using GCC:
>>
>> http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/8661/steps/test5/logs/stdio
>>
>> On Thu, Nov 19, 2015 at 4:11 PM, Adrian McCarthy via lldb-commits
>> <lldb-commits at lists.llvm.org> wrote:
>> > Author: amccarth
>> > Date: Thu Nov 19 18:11:38 2015
>> > New Revision: 253623
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=253623&view=rev
>> > Log:
>> > Make skipIf support the not_in function.
>> >
>> > Modified:
>> >     lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
>> >
>> > Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
>> > URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py?rev=253623&r1=253622&r2=253623&view=diff
>> >
>> ==============================================================================
>> > --- lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py (original)
>> > +++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py Thu Nov 19
>> 18:11:38 2015
>> > @@ -1100,10 +1100,10 @@ def skipIfLinuxClang(func):
>> >  # TODO: refactor current code, to make skipIfxxx functions to call
>> this function
>> >  def skipIf(bugnumber=None, oslist=None, compiler=None,
>> compiler_version=None, archs=None, debug_info=None, swig_version=None,
>> py_version=None):
>> >      def fn(self):
>> > -        oslist_passes = oslist is None or self.getPlatform() in oslist
>> > -        compiler_passes = compiler is None or (compiler in
>> self.getCompiler() and self.expectedCompilerVersion(compiler_version))
>> > +        oslist_passes = check_list_or_lambda(oslist,
>> self.getPlatform())
>> > +        compiler_passes = check_list_or_lambda(compiler,
>> self.getCompiler()) and self.expectedCompilerVersion(compiler_version)
>> >          arch_passes = self.expectedArch(archs)
>> > -        debug_info_passes = debug_info is None or self.debug_info in
>> debug_info
>> > +        debug_info_passes = check_list_or_lambda(debug_info,
>> self.debug_info)
>> >          swig_version_passes = (swig_version is None) or (not
>> hasattr(lldb, 'swig_version')) or (check_expected_version(swig_version[0],
>> swig_version[1], lldb.swig_version))
>> >          py_version_passes = (py_version is None) or
>> check_expected_version(py_version[0], py_version[1], sys.version_info)
>> >
>> >
>> >
>> > _______________________________________________
>> > lldb-commits mailing list
>> > lldb-commits at lists.llvm.org
>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151120/5b99ab83/attachment.html>


More information about the lldb-commits mailing list