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

Unified Diff: tools/binary_size/integration_test.py

Issue 2801663003: //tools/binary_size: Add Disassemble() to console.py. Tweak metadata. (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 0523d913be9da943e90a926d81ce61736f47b06c..32ac776111525f10b44ad305313bead6c0fef1d3 100755
--- a/tools/binary_size/integration_test.py
+++ b/tools/binary_size/integration_test.py
@@ -14,8 +14,10 @@ import sys
import tempfile
import describe
+import file_format
import map2size
import models
+import paths
_SCRIPT_DIR = os.path.dirname(__file__)
@@ -58,17 +60,17 @@ def _RunApp(name, *args):
class IntegrationTest(unittest.TestCase):
size_info = None
- def _GetParsedMap(self):
+ def _CloneSizeInfo(self):
if not IntegrationTest.size_info:
- IntegrationTest.size_info = map2size.Analyze(
- _TEST_MAP_PATH, output_directory=_TEST_DATA_DIR)
+ lazy_paths = paths.LazyPaths(output_directory=_TEST_DATA_DIR)
+ IntegrationTest.size_info = map2size.Analyze(_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,
- _TEST_MAP_PATH, temp_file.name)
+ '--map-file', _TEST_MAP_PATH, '', temp_file.name)
size_info = map2size.Analyze(temp_file.name)
sym_strs = (repr(sym) for sym in size_info.symbols)
stats = describe.DescribeSizeInfoCoverage(size_info)
@@ -76,14 +78,15 @@ class IntegrationTest(unittest.TestCase):
@_CompareWithGolden
def test_ConsoleNullDiff(self):
- return _RunApp('console.py', '--output-directory', _TEST_DATA_DIR,
- '--query', 'Diff(size_info1, size_info2)',
- _TEST_MAP_PATH, _TEST_MAP_PATH)
+ with tempfile.NamedTemporaryFile(suffix='.size') as temp_file:
+ file_format.SaveSizeInfo(self._CloneSizeInfo(), temp_file.name)
+ return _RunApp('console.py', '--query', 'Diff(size_info1, size_info2)',
+ temp_file.name, temp_file.name)
@_CompareWithGolden
def test_ActualDiff(self):
- map1 = self._GetParsedMap()
- map2 = self._GetParsedMap()
+ map1 = self._CloneSizeInfo()
+ map2 = self._CloneSizeInfo()
map1.symbols -= map1.symbols[0]
map2.symbols -= map2.symbols[-1]
map1.symbols[1].size -= 10
@@ -92,7 +95,7 @@ class IntegrationTest(unittest.TestCase):
@_CompareWithGolden
def test_SymbolGroupMethods(self):
- all_syms = self._GetParsedMap().symbols
+ all_syms = self._CloneSizeInfo().symbols
global_syms = all_syms.WhereNameMatches('GLOBAL')
# Tests Filter(), Inverted(), and __sub__().
non_global_syms = global_syms.Inverted()
« 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