Summary: | Introduce SpecifierSorter, a thing that knows how specifiers should be ordered. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dimitri Glazkov (Google) <dglazkov> | ||||||
Component: | Tools / Tests | Assignee: | Dimitri Glazkov (Google) <dglazkov> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 64385, 65444 | ||||||||
Attachments: |
|
Description
Dimitri Glazkov (Google)
2011-07-30 11:18:25 PDT
Created attachment 102438 [details]
WIP:Switching computers.
Created attachment 102440 [details]
Patch
Comment on attachment 102440 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=102440&action=review > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:84 > + def add_specifier(self, category, specifier): > + self._specifier_to_category[specifier] = category Should this be private? > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:99 > + category_slots = [] > + for i in range(len(TestConfiguration.category_order())): > + category_slots.append([]) category_slots = [[]] * len(TestConfiguration.category_order()) or category_slots = map(lambda x: [], TestConfiguration.category_order()) (In reply to comment #3) > (From update of attachment 102440 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=102440&action=review > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:84 > > + def add_specifier(self, category, specifier): > > + self._specifier_to_category[specifier] = category > > Should this be private? > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:99 > > + category_slots = [] > > + for i in range(len(TestConfiguration.category_order())): > > + category_slots.append([]) > > category_slots = [[]] * len(TestConfiguration.category_order()) This will give you a somewhat unexpected effect of having one array listed N times: >>> a = ([[]] * 10) >>> a[0].append('zoot') >>> a [['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot']] > > or > > category_slots = map(lambda x: [], TestConfiguration.category_order()) Now, _that_ is cool. (In reply to comment #3) > (From update of attachment 102440 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=102440&action=review > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:84 > > + def add_specifier(self, category, specifier): > > + self._specifier_to_category[specifier] = category > > Should this be private? > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:99 > > + category_slots = [] > > + for i in range(len(TestConfiguration.category_order())): > > + category_slots.append([]) > > category_slots = [[]] * len(TestConfiguration.category_order()) > > or > > category_slots = map(lambda x: [], TestConfiguration.category_order()) (In reply to comment #3) > (From update of attachment 102440 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=102440&action=review > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:84 > > + def add_specifier(self, category, specifier): > > + self._specifier_to_category[specifier] = category > > Should this be private? No, I use it to populate the specifier in TestConfigurationConverter. (In reply to comment #4) > (In reply to comment #3) > > (From update of attachment 102440 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=102440&action=review > > > > > Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py:99 > > > + category_slots = [] > > > + for i in range(len(TestConfiguration.category_order())): > > > + category_slots.append([]) > > > > category_slots = [[]] * len(TestConfiguration.category_order()) > > This will give you a somewhat unexpected effect of having one array listed N times: > > >>> a = ([[]] * 10) > >>> a[0].append('zoot') > >>> a > [['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot'], ['zoot']] Doh! Committed r92136: <http://trac.webkit.org/changeset/92136> |