Changeset 96441 in webkit
- Timestamp:
- Sep 30, 2011 5:39:52 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r96439 r96441 1 2011-09-30 David Levin <levin@chromium.org> 2 3 watchlist: Add a way to detect a net increase or decrease of a pattern (in a file). 4 https://bugs.webkit.org/show_bug.cgi?id=69031 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/common/config/watchlist: Added usage of the new pattern, 9 a comment to explain something important about the email addresses, and 10 a comment to let emacs know to treat the file as a python file. 11 * Scripts/webkitpy/common/watchlist/amountchangedpattern.py: Added. 12 Detects increases or decreases in a pattern. 13 * Scripts/webkitpy/common/watchlist/amountchangedpattern_unittest.py: Added. 14 * Scripts/webkitpy/common/watchlist/watchlist_unittest.py: 15 Added unit tests for watchlist which has "more" or "less". 16 * Scripts/webkitpy/common/watchlist/watchlistparser.py: 17 Added support for "more" or "less". 18 1 19 2011-09-30 Sam Weinig <sam@webkit.org> 2 20 -
trunk/Tools/Scripts/webkitpy/common/config/watchlist
r96263 r96441 1 # -*- mode: Python;-*- 1 2 { 2 3 "DEFINITIONS": { 3 4 "WatchListScript": { 4 "filename": (r"Tools/Scripts/webkitpy/common/watchlist/.*"), 5 "filename": r"Tools/Scripts/webkitpy/common/watchlist/.*", 6 }, 7 "ThreadingFiles": { 8 "filename": r"Source/JavaScriptCore/wtf/ThreadSafeRefCounted\.h" 9 r"|Source/JavaScriptCore/wtf/Threading\.h", 10 }, 11 "ThreadingUsage": { 12 "more": r"deprecatedTurnOffVerifier|crossThreadString|threadsafeCopy|ThreadSafeRefCounted|CrossThreadRefCounted", 5 13 }, 6 14 }, 7 15 "CC_RULES": { 16 # Note: All email addresses listed must be registered with bugzilla. 17 # Specifically, levin@chromium.org and levin+threading@chromium.org are 18 # two different accounts as far as bugzilla is concerned. 8 19 "WatchListScript": [ "levin+watchlist@chromium.org", ], 20 "ThreadingFiles|ThreadingUsage": [ "levin+threading@chromium.org", ], 9 21 }, 10 22 } -
trunk/Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py
r96390 r96441 213 213 }, cc_set_and_messages) 214 214 215 def test_more_and_less_match(self): 216 watch_list = self._watch_list_parser.parse( 217 '{' 218 ' "DEFINITIONS": {' 219 ' "WatchList1": {' 220 # This pattern is in both added and deleted lines, so no match. 221 ' "more": r"userSelect == o\.userSelect",' 222 ' },' 223 ' "WatchList2": {' 224 ' "more": r"boxOrient\(o\.boxOrient\)",' 225 ' },' 226 ' "WatchList3": {' 227 ' "less": r"unsigned orient"' 228 ' },' 229 ' },' 230 ' "CC_RULES": {' 231 ' "WatchList1": [ "eric@webkit.org", ],' 232 ' "WatchList2": [ "levin@chromium.org", ],' 233 ' },' 234 ' "MESSAGE_RULES": {' 235 ' "WatchList3": ["Test message."],' 236 ' },' 237 '}') 238 cc_set_and_messages = watch_list.determine_cc_set_and_messages(DIFF_TEST_DATA) 239 self.assertEquals({ 240 'cc_set': set(['levin@chromium.org']), 241 'messages': set(["Test message."]), 242 }, cc_set_and_messages) 243 215 244 def test_complex_match(self): 216 245 watch_list = self._watch_list_parser.parse( … … 219 248 ' "WatchList1": {' 220 249 ' "filename": r"WebCore/rendering/style/StyleRareInheritedData\.cpp",' 221 ' "in_added_lines": r"\&\& boxOrient == o.boxOrient;",' 222 ' "in_deleted_lines": r"\&\& userSelect == o.userSelect;",' 250 ' "in_added_lines": r"\&\& boxOrient == o\.boxOrient;",' 251 ' "in_deleted_lines": r"\&\& userSelect == o\.userSelect;",' 252 ' "more": r"boxOrient\(o\.boxOrient\)",' 223 253 ' },' 224 254 ' "WatchList2": {' 225 255 ' "filename": r"WebCore/rendering/style/StyleRareInheritedData\.cpp",' 226 256 ' "in_added_lines": r"RenderStyle::initialBoxOrient",' 257 ' "less": r"userSelect;"' 227 258 ' },' 228 259 # WatchList3 won't match because these two patterns aren't in the same file. -
trunk/Tools/Scripts/webkitpy/common/watchlist/watchlistparser.py
r96390 r96441 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 29 30 import difflib 30 31 import re 31 32 33 from webkitpy.common.watchlist.amountchangedpattern import AmountChangedPattern 32 34 from webkitpy.common.watchlist.changedlinepattern import ChangedLinePattern 33 35 from webkitpy.common.watchlist.filenamepattern import FilenamePattern … … 52 54 'in_added_lines': (lambda regex: ChangedLinePattern(regex, 0)), 53 55 'in_deleted_lines': (lambda regex: ChangedLinePattern(regex, 1)), 56 'less': (lambda regex: AmountChangedPattern(regex, 1)), 57 'more': (lambda regex: AmountChangedPattern(regex, 0)), 54 58 } 55 59
Note: See TracChangeset
for help on using the changeset viewer.