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

Unified Diff: tools/binary_size/integration_test.py

Issue 2809043003: //tools/binary_size: Group [clone] and ** symbols (Closed)
Patch Set: review comments Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/binary_size/file_format.py ('k') | tools/binary_size/map2size.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/binary_size/integration_test.py
diff --git a/tools/binary_size/integration_test.py b/tools/binary_size/integration_test.py
index 179d22b3b28166f6cb11746d7da503fec8614ab8..40c3d6ea61cc9b97c828c2e25bca24a71283ed65 100755
--- a/tools/binary_size/integration_test.py
+++ b/tools/binary_size/integration_test.py
@@ -63,19 +63,38 @@ class IntegrationTest(unittest.TestCase):
def _CloneSizeInfo(self):
if not IntegrationTest.size_info:
lazy_paths = paths.LazyPaths(output_directory=_TEST_DATA_DIR)
- IntegrationTest.size_info = map2size.Analyze(_TEST_MAP_PATH, lazy_paths)
+ IntegrationTest.size_info = (
+ map2size.CreateSizeInfo(_TEST_MAP_PATH, lazy_paths))
return copy.deepcopy(IntegrationTest.size_info)
@_CompareWithGolden
def test_Map2Size(self):
with tempfile.NamedTemporaryFile(suffix='.size') as temp_file:
_RunApp('map2size.py', '--output-directory', _TEST_DATA_DIR,
- '--map-file', _TEST_MAP_PATH, '', temp_file.name)
- size_info = map2size.Analyze(temp_file.name)
+ '--map-file', _TEST_MAP_PATH, '--elf-file', '',
+ '--output-file', temp_file.name)
+ size_info = map2size.LoadAndPostProcessSizeInfo(temp_file.name)
+ # Check that saving & loading is the same as directly parsing the .map.
+ expected_size_info = self._CloneSizeInfo()
+ self.assertEquals(expected_size_info.metadata, size_info.metadata)
+ expected = '\n'.join(describe.GenerateLines(
+ expected_size_info, verbose=True, recursive=True)),
+ actual = '\n'.join(describe.GenerateLines(
+ size_info, verbose=True, recursive=True)),
+ self.assertEquals(expected, actual)
+
sym_strs = (repr(sym) for sym in size_info.symbols)
stats = describe.DescribeSizeInfoCoverage(size_info)
return itertools.chain(stats, sym_strs)
+ def test_Map2Size_NoSourcePaths(self):
+ # Just tests that it doesn't crash.
+ with tempfile.NamedTemporaryFile(suffix='.size') as temp_file:
+ _RunApp('map2size.py', '--no-source-paths',
+ '--map-file', _TEST_MAP_PATH, '--elf-file', '',
+ '--output-file', temp_file.name)
+ map2size.LoadAndPostProcessSizeInfo(temp_file.name)
+
@_CompareWithGolden
def test_ConsoleNullDiff(self):
with tempfile.NamedTemporaryFile(suffix='.size') as temp_file:
@@ -96,6 +115,10 @@ class IntegrationTest(unittest.TestCase):
return describe.GenerateLines(diff, verbose=True)
@_CompareWithGolden
+ def test_FullDescription(self):
+ return describe.GenerateLines(self._CloneSizeInfo())
+
+ @_CompareWithGolden
def test_SymbolGroupMethods(self):
all_syms = self._CloneSizeInfo().symbols
global_syms = all_syms.WhereNameMatches('GLOBAL')
« no previous file with comments | « tools/binary_size/file_format.py ('k') | tools/binary_size/map2size.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698