rewrite_to_chrome_style doesn't rewrite method names used in EXPECT_CALL / in gmock macro invocations |
||||||
Issue descriptionFor example: EXPECT_CALL(mocked_interface, myMethod(123)); should be rewritten to EXPECT_CALL(mocked_interface, MyMethod(123));
,
Jan 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b5ca969e8001ef2d6292e92f0d1203e02fba30ec commit b5ca969e8001ef2d6292e92f0d1203e02fba30ec Author: lukasza <lukasza@chromium.org> Date: Mon Jan 09 21:18:18 2017 Renaming blink method names inside gmock's EXPECT_CALL macro invocation. BUG= 677544 Review-Url: https://codereview.chromium.org/2609473002 Cr-Commit-Position: refs/heads/master@{#442347} [modify] https://crrev.com/b5ca969e8001ef2d6292e92f0d1203e02fba30ec/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp [add] https://crrev.com/b5ca969e8001ef2d6292e92f0d1203e02fba30ec/tools/clang/rewrite_to_chrome_style/tests/gmock-expected.cc [add] https://crrev.com/b5ca969e8001ef2d6292e92f0d1203e02fba30ec/tools/clang/rewrite_to_chrome_style/tests/gmock-original.cc [modify] https://crrev.com/b5ca969e8001ef2d6292e92f0d1203e02fba30ec/tools/clang/scripts/run_tool.py [modify] https://crrev.com/b5ca969e8001ef2d6292e92f0d1203e02fba30ec/tools/clang/scripts/test_tool.py
,
Jan 9 2017
,
Jan 23 2017
This is still a problem. Example: ../../third_party/WebKit/Source/platform/graphics/ContiguousContainerTest.cpp:88:5: error: no member named 'gmock_destruct' in 'blink::(anonymous namespace)::MockDestructible'; did you mean 'gmock_Destruct'?
,
Jan 23 2017
Fix for the issue in #c4 is proposed at https://crrev.com/2654553003
,
Jan 23 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b420e30cbfb04c5eebf6e9be6835ca89ad21e86e commit b420e30cbfb04c5eebf6e9be6835ca89ad21e86e Author: lukasza <lukasza@chromium.org> Date: Mon Jan 23 21:10:32 2017 Handle renaming of mocked methods that are not virtual. BUG= 677544 Review-Url: https://codereview.chromium.org/2654553003 Cr-Commit-Position: refs/heads/master@{#445484} [modify] https://crrev.com/b420e30cbfb04c5eebf6e9be6835ca89ad21e86e/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp [modify] https://crrev.com/b420e30cbfb04c5eebf6e9be6835ca89ad21e86e/tools/clang/rewrite_to_chrome_style/tests/gmock-expected.cc [modify] https://crrev.com/b420e30cbfb04c5eebf6e9be6835ca89ad21e86e/tools/clang/rewrite_to_chrome_style/tests/gmock-original.cc
,
Jan 25 2017
Still some remaining trouble:
$ cat ~/scratch/ninja.err | grep 'error:.*did you mean' | sed -e "s/^.*\\(did you mean '[a-zA-Z0-9_]*'\\).*$/\\1/g" | sort | uniq -c | sort -n | grep gmock
1 did you mean 'gmock_BeginRead'
1 did you mean 'gmock_Complete'
1 did you mean 'gmock_DidAddRemoteStream'
1 did you mean 'gmock_DidConsumeBufferedAmount'
1 did you mean 'gmock_DidGenerateICECandidate'
1 did you mean 'gmock_DidRemoveRemoteStream'
1 did you mean 'gmock_DrainAsBlobDataHandle'
1 did you mean 'gmock_DrainAsFormData'
1 did you mean 'gmock_EndRead'
1 did you mean 'gmock_GetPublicState'
1 did you mean 'gmock_HandleContextDestroyed'
1 did you mean 'gmock_UserAgentOverride'
2 did you mean 'gmock_Call'
3 did you mean 'gmock_Run'
19 did you mean 'gmock_WillOverwriteCanvas'
,
Jan 25 2017
We only handle EXPECT_CALL and missed ON_CALL macro... doh...
,
Jan 25 2017
Although there are also some other remaining issues (maybe sufficiently few to just tackle them manually): - EXPECT_CALL nested in TEST_OVERDRAW_SETUP doesn't get its |willOverwriteCanvas| call rewritten to |WillOverwriteCanvas|.
,
Jan 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a798de99a96ac2c9726b1ad4fe10630a34bb47c5 commit a798de99a96ac2c9726b1ad4fe10630a34bb47c5 Author: lukasza <lukasza@chromium.org> Date: Thu Jan 26 17:37:48 2017 Rename method names used inside GMock's ON_CALL macro calls. BUG= 677544 Review-Url: https://codereview.chromium.org/2655793004 Cr-Commit-Position: refs/heads/master@{#446365} [modify] https://crrev.com/a798de99a96ac2c9726b1ad4fe10630a34bb47c5/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp [modify] https://crrev.com/a798de99a96ac2c9726b1ad4fe10630a34bb47c5/tools/clang/rewrite_to_chrome_style/tests/gmock-expected.cc [modify] https://crrev.com/a798de99a96ac2c9726b1ad4fe10630a34bb47c5/tools/clang/rewrite_to_chrome_style/tests/gmock-original.cc
,
Jan 26 2017
Hopefully this is fixed, but let's keep this open until we verify via a dry-run of the Great Blink Rename.
,
Feb 3 2017
There are no more gmock problems after the latest dry-run of the rename. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by lukasza@chromium.org
, Dec 29 2016