[qmtest] patch: Various enhancements and fixes

Mark Mitchell mark at codesourcery.com
Fri Jun 2 20:58:41 UTC 2006


Stefan Seefeld wrote:
> The attached patch contains a number of enhancements and fixes:
> 
> A new function is provided to parse quoted text into a list of strings,
> useful notably to handle context variables, which may contain
> whitespace-containing paths (such as -I and -L compiler options).
> 
> The compilation_test module has been enhanced to provide an
> 'ExecutableTest' that runs a binary previously compiled with the
> 'CompiledResource'.
> 
> CompilationTest and ExecutableTest now take an optional 'target' / 'host'
> context variable that allows cross-compilation / cross-testing.

> Index: qm/extension.py
> ===================================================================
> RCS file: /home/qm/Repository/qm/qm/extension.py,v
> retrieving revision 1.20
> diff -u -r1.20 extension.py
> --- qm/extension.py	1 Dec 2005 08:27:12 -0000	1.20
> +++ qm/extension.py	2 Jun 2006 12:54:48 -0000
> @@ -151,7 +151,8 @@
>          if __debug__:
>              dictionary = get_class_arguments_as_dictionary(self.__class__)
>              for a, v in arguments.items():
> -                assert dictionary.has_key(a)
> +                if not dictionary.has_key(a):
> +                    raise AttributeError, a

What is the logic for this change?  We're in __debug__ so we know assert
will work.  I'm fine with the change; I'm just curious as to the reason.

> +    def GetStringList(self, key, default = None):
> +        """Return the list of strings associated with 'key'.
> +
> +        'key' -- A string.
> +
> +        'default' -- A default list.
> +
> +        If there is no value associated with 'key' and default is not
> +        'None', then the boolean value associated with default is
> +        used.  

What do you mean "boolean value"?  It looks like you just return
default.  It also seems like "[]" would be a better default.

Other than that, it looks great.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713



More information about the qmtest mailing list