Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1202)

Side by Side Diff: tools/binary_size/libsupersize/function_signature_test.py

Issue 2880003002: supersize: A few fixes for Android+clang builds (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved. 2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import logging 6 import logging
7 import re 7 import re
8 import unittest 8 import unittest
9 9
10 import function_signature 10 import function_signature
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 function_signature.Parse(SIG)) 103 function_signature.Parse(SIG))
104 self.assertEqual('(anonymous namespace)::Foo::Baz', got_name) 104 self.assertEqual('(anonymous namespace)::Foo::Baz', got_name)
105 self.assertEqual('(anonymous namespace)::Foo::Baz', got_template_name) 105 self.assertEqual('(anonymous namespace)::Foo::Baz', got_template_name)
106 self.assertEqual(SIG, got_full_name) 106 self.assertEqual(SIG, got_full_name)
107 107
108 # Top-level lambda. 108 # Top-level lambda.
109 # Note: Inline lambdas do not seem to be broken into their own symbols. 109 # Note: Inline lambdas do not seem to be broken into their own symbols.
110 SIG = 'cc::{lambda(cc::PaintOp*)#63}::_FUN(cc::PaintOp*)' 110 SIG = 'cc::{lambda(cc::PaintOp*)#63}::_FUN(cc::PaintOp*)'
111 got_full_name, got_template_name, got_name = ( 111 got_full_name, got_template_name, got_name = (
112 function_signature.Parse(SIG)) 112 function_signature.Parse(SIG))
113 self.assertEqual('cc::{lambda#63}', got_name) 113 self.assertEqual('cc::$lambda#63', got_name)
114 self.assertEqual('cc::{lambda#63}', got_template_name) 114 self.assertEqual('cc::$lambda#63', got_template_name)
115 self.assertEqual('cc::{lambda#63}(cc::PaintOp*)', got_full_name) 115 self.assertEqual('cc::$lambda#63(cc::PaintOp*)', got_full_name)
116
117 SIG = 'cc::$_63::__invoke(cc::PaintOp*)'
118 got_full_name, got_template_name, got_name = (
119 function_signature.Parse(SIG))
120 self.assertEqual('cc::$lambda#63', got_name)
121 self.assertEqual('cc::$lambda#63', got_template_name)
122 self.assertEqual('cc::$lambda#63(cc::PaintOp*)', got_full_name)
116 123
117 # Data members 124 # Data members
118 check('', 'blink::CSSValueKeywordsHash::findValueImpl', '(char const*)', 125 check('', 'blink::CSSValueKeywordsHash::findValueImpl', '(char const*)',
119 '::value_word_list') 126 '::value_word_list')
120 check('', 'foo::Bar<Z<Y> >::foo<bar>', '(abc)', '::var<baz>', 127 check('', 'foo::Bar<Z<Y> >::foo<bar>', '(abc)', '::var<baz>',
121 name_without_templates='foo::Bar::foo::var') 128 name_without_templates='foo::Bar::foo::var')
122 129
123 if __name__ == '__main__': 130 if __name__ == '__main__':
124 logging.basicConfig(level=logging.DEBUG, 131 logging.basicConfig(level=logging.DEBUG,
125 format='%(levelname).1s %(relativeCreated)6d %(message)s') 132 format='%(levelname).1s %(relativeCreated)6d %(message)s')
126 unittest.main() 133 unittest.main()
OLDNEW
« no previous file with comments | « tools/binary_size/libsupersize/function_signature.py ('k') | tools/binary_size/libsupersize/linker_map_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698