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

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

Issue 23600042: ninja&make/mac: Only pass -x for loadable_modules. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 3 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
Index: test/mac/gyptest-strip-default.py
===================================================================
--- test/mac/gyptest-strip-default.py (revision 0)
+++ test/mac/gyptest-strip-default.py (revision 0)
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
Mark Mentovai 2013/09/13 16:09:05 2013
Nico 2013/09/13 20:11:07 Time flies! Done.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies that the default STRIP_STYLEs match between different generators.
+"""
+
+import TestGyp
+
+import re
+import subprocess
+import sys
+import time
+
+if sys.platform == 'darwin':
+ test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
+
+ CHDIR='strip'
+ test.run_gyp('test-defaults.gyp', chdir=CHDIR)
+
+ test.build('test-defaults.gyp', test.ALL, chdir=CHDIR)
+
+ # Lightweight check if stripping was done.
+ def OutPath(s):
+ return test.built_file_path(s, chdir=CHDIR)
+
+ def CheckNsyms(p, n_expected):
+ r = re.compile(r'nsyms\s+(\d+)')
+ proc = subprocess.Popen(['otool', '-l', p], stdout=subprocess.PIPE)
Mark Mentovai 2013/09/13 16:09:05 Compare the output of nm -aU instead? That gives y
Nico 2013/09/13 20:11:07 Oh, nice. Why -U? (Done for `nm -a`)
Mark Mentovai 2013/09/13 21:31:32 Nico wrote:
+ o = proc.communicate()[0]
+ assert not proc.returncode
+ 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()
+
+ # The actual numbers here are not interesting, they just need to be the same
+ # in both the xcode and the ninja build.
+ CheckNsyms(OutPath('libsingle_dylib.dylib'), 2)
+ CheckNsyms(OutPath('single_so.so'), 2)
+ CheckNsyms(OutPath('single_exe'), 2)
+
+ CheckNsyms(test.built_file_path(
+ 'bundle_dylib.framework/Versions/A/bundle_dylib', chdir=CHDIR), 2)
+ CheckNsyms(test.built_file_path(
+ 'bundle_so.bundle/Contents/MacOS/bundle_so', chdir=CHDIR), 2)
+ CheckNsyms(test.built_file_path(
+ 'bundle_exe.app/Contents/MacOS/bundle_exe', chdir=CHDIR), 2)
+
+ test.pass_test()
+
Mark Mentovai 2013/09/13 16:09:05 Blank line at EOF.
Nico 2013/09/13 20:11:07 Done.
Property changes on: test/mac/gyptest-strip-default.py
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « test/mac/gyptest-cflags.py ('k') | test/mac/strip/main.c » ('j') | test/mac/strip/main.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698