Good, we do plan to patch lots of existing client tests. And this is just a
beginning.
Now I include disktest and dbench just as examples:
Index: client/tests/dbench/dbench.py
===================================================================
--- client/tests/dbench/dbench.py (revision 4747)
+++ client/tests/dbench/dbench.py (working copy)
@@ -13,7 +13,7 @@
utils.system('patch -p1 < ../dbench_startup.patch')
utils.configure()
- utils.system('make')
+ utils.make()
def initialize(self):
Index: client/tests/disktest/disktest.py
===================================================================
--- client/tests/disktest/disktest.py (revision 4747)
+++ client/tests/disktest/disktest.py (working copy)
@@ -23,8 +23,8 @@
Compiles disktest.
"""
os.chdir(self.srcdir)
- utils.system('make clean')
- utils.system('make')
+ utils.make('clean')
+ utils.make()
def initialize(self):
Index: client/common_lib/utils.py
===================================================================
--- client/common_lib/utils.py (revision 4747)
+++ client/common_lib/utils.py (working copy)
@@ -1165,6 +1165,16 @@
system('%s %s' % (configure, ' '.join(args)))
+def make(extra='', make='make', timeout=None, ignore_status=False):
+ """
+ Run make, adding MAKEOPTS to the list of options.
+
+ @param extra: extra command line arguments to pass to make.
+ """
+ cmd = '%s %s %s' % (make, os.environ.get('MAKEOPTS', ''), extra)
+ return system(cmd, timeout=timeout, ignore_status=ignore_status)
+
+
def compare_versions(ver1, ver2):
"""Version number comparison between ver1 and ver2 strings.
On Fri, Aug 13, 2010 at 1:54 PM, John Admanski <[email protected]> wrote:
> Looks fine. It wouldn't hurt to see a patch to at least one test to have it
> make use of this function.
>
> -- John
>
>
> On Fri, Aug 13, 2010 at 1:53 PM, Eric Li(李咏竹) <[email protected]> wrote:
>
>> Thanks for the quick response. Please take another look.
>>
>>
>> Index: client/common_lib/utils.py
>> ===================================================================
>> --- client/common_lib/utils.py (revision 4747)
>> +++ client/common_lib/utils.py (working copy)
>> @@ -1165,6 +1165,16 @@
>> system('%s %s' % (configure, ' '.join(args)))
>>
>>
>> +def make(extra='', make='make', timeout=None, ignore_status=False):
>> + """
>> + Run make, adding MAKEOPTS to the list of options.
>> +
>> + @param extra: extra command line arguments to pass to make.
>> + """
>> + cmd = '%s %s %s' % (make, os.environ.get('MAKEOPTS', ''), extra)
>> + return system(cmd, timeout=timeout, ignore_status=ignore_status)
>> +
>> +
>> def compare_versions(ver1, ver2):
>> """Version number comparison between ver1 and ver2 strings.
>>
>>
>> On Fri, Aug 13, 2010 at 1:51 PM, John Admanski <[email protected]>wrote:
>>
>>> It should be consistent and use single-quoted strings for all of the
>>> string literals, but otherwise looks fine.
>>>
>>> -- John
>>>
>>>
>>> On Fri, Aug 13, 2010 at 1:49 PM, Eric Li(李咏竹) <[email protected]> wrote:
>>>
>>>> The idea here is to add -j option to most of our client tests at
>>>> pre-build stage. From our experiment, it reduced almost 50% of our build
>>>> time.
>>>>
>>>> The original author of this CL is CCed.
>>>>
>>>>
>>>> Index: client/common_lib/utils.py
>>>> ===================================================================
>>>> --- client/common_lib/utils.py (revision 4747)
>>>> +++ client/common_lib/utils.py (working copy)
>>>> @@ -1165,6 +1165,16 @@
>>>> system('%s %s' % (configure, ' '.join(args)))
>>>>
>>>>
>>>> +def make(extra='', make='make', timeout=None, ignore_status=False):
>>>> + """
>>>> + Run make, adding MAKEOPTS to the list of options.
>>>> +
>>>> + @param extra: extra command line arguments to pass to make.
>>>> + """
>>>> + cmd = '%s %s %s' % (make, os.environ.get("MAKEOPTS", ""), extra)
>>>>
>>> + return system(cmd, timeout=timeout, ignore_status=ignore_status)
>>>> +
>>>> +
>>>> def compare_versions(ver1, ver2):
>>>> """Version number comparison between ver1 and ver2 strings.
>>>>
>>>>
>>>> --
>>>> Eric Li
>>>> 李咏竹
>>>> Google Kirkland
>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Eric Li
>> 李咏竹
>> Google Kirkland
>>
>>
>>
>
--
Eric Li
李咏竹
Google Kirkland
Index: client/tests/dbench/dbench.py
===================================================================
--- client/tests/dbench/dbench.py (revision 4747)
+++ client/tests/dbench/dbench.py (working copy)
@@ -13,7 +13,7 @@
utils.system('patch -p1 < ../dbench_startup.patch')
utils.configure()
- utils.system('make')
+ utils.make()
def initialize(self):
Index: client/tests/disktest/disktest.py
===================================================================
--- client/tests/disktest/disktest.py (revision 4747)
+++ client/tests/disktest/disktest.py (working copy)
@@ -23,8 +23,8 @@
Compiles disktest.
"""
os.chdir(self.srcdir)
- utils.system('make clean')
- utils.system('make')
+ utils.make('clean')
+ utils.make()
def initialize(self):
Index: client/common_lib/utils.py
===================================================================
--- client/common_lib/utils.py (revision 4747)
+++ client/common_lib/utils.py (working copy)
@@ -1165,6 +1165,16 @@
system('%s %s' % (configure, ' '.join(args)))
+def make(extra='', make='make', timeout=None, ignore_status=False):
+ """
+ Run make, adding MAKEOPTS to the list of options.
+
+ @param extra: extra command line arguments to pass to make.
+ """
+ cmd = '%s %s %s' % (make, os.environ.get('MAKEOPTS', ''), extra)
+ return system(cmd, timeout=timeout, ignore_status=ignore_status)
+
+
def compare_versions(ver1, ver2):
"""Version number comparison between ver1 and ver2 strings.
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest