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

Unified Diff: test/mac/gyptest-strip.py

Issue 197073002: Fix test/mac/gyptest-strip.py with Xcode 5.0 or higher (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Address comments Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mac/gyptest-strip.py
diff --git a/test/mac/gyptest-strip.py b/test/mac/gyptest-strip.py
index 9ab26a558c0d43c634782f2e23cdf3de45b02b2a..e2c06c13589eb8359b9828dbadcdef192040572d 100755
--- a/test/mac/gyptest-strip.py
+++ b/test/mac/gyptest-strip.py
@@ -9,6 +9,7 @@ Verifies that stripping works.
"""
import TestGyp
+import TestMac
import re
import subprocess
@@ -28,19 +29,25 @@ if sys.platform == 'darwin':
def CheckNsyms(p, n_expected):
r = re.compile(r'nsyms\s+(\d+)')
- proc = subprocess.Popen(['otool', '-l', p], stdout=subprocess.PIPE)
- o = proc.communicate()[0]
- assert not proc.returncode
+ o = subprocess.check_output(['otool', '-l', p])
m = r.search(o)
n = int(m.group(1))
if n != n_expected:
print 'Stripping: Expected %d symbols, got %d' % (n_expected, n)
test.fail_test()
+ # Starting with Xcode 5.0, clang adds an additional symbols to the compiled
+ # file when using a relative path to the input file. So when using ninja
+ # with Xcode 5.0 or higher, take this additional symbol into consideration
+ # for unstripped builds (it is stripped by all strip commands).
+ expected_extra_symbol_count = 0
+ if test.format == 'ninja' and TestMac.Xcode.Version() >= '0500':
+ expected_extra_symbol_count = 1
+
# The actual numbers here are not interesting, they just need to be the same
# in both the xcode and the make build.
- CheckNsyms(OutPath('no_postprocess'), 29)
- CheckNsyms(OutPath('no_strip'), 29)
+ CheckNsyms(OutPath('no_postprocess'), 29 + expected_extra_symbol_count)
+ CheckNsyms(OutPath('no_strip'), 29 + expected_extra_symbol_count)
CheckNsyms(OutPath('strip_all'), 0)
CheckNsyms(OutPath('strip_nonglobal'), 6)
CheckNsyms(OutPath('strip_debugging'), 7)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698