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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 # Copyright (c) 2013 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """
8 Verifies that the default STRIP_STYLEs match between different generators.
9 """
10
11 import TestGyp
12
13 import re
14 import subprocess
15 import sys
16 import time
17
18 if sys.platform == 'darwin':
19 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
20
21 CHDIR='strip'
22 test.run_gyp('test-defaults.gyp', chdir=CHDIR)
23
24 test.build('test-defaults.gyp', test.ALL, chdir=CHDIR)
25
26 # Lightweight check if stripping was done.
27 def OutPath(s):
28 return test.built_file_path(s, chdir=CHDIR)
29
30 def CheckNsyms(p, o_expected):
31 proc = subprocess.Popen(['nm', '-aU', p], stdout=subprocess.PIPE)
32 o = proc.communicate()[0].replace('A', 'T')
33 assert not proc.returncode
34 if o != o_expected:
35 print 'Stripping: Expected symbols """\n%s""", got """\n%s"""' % (
36 o_expected, o)
37 test.fail_test()
38
39 # The actual numbers here are not interesting, they just need to be the same
40 # in both the xcode and the ninja build.
41 CheckNsyms(OutPath('libsingle_dylib.dylib'),
42 """\
43 00001000 S _i
Mark Mentovai 2013/09/13 21:50:36 You’ve still gotta deal with all of these numbers.
Nico 2013/09/13 22:05:49 Done.
44 00000fb3 T _the_function
45 00000fa9 t _the_hidden_function
46 00000fa4 T _the_used_function
47 00000fae T _the_visible_function
48 """)
49 CheckNsyms(OutPath('single_so.so'),
50 """\
51 00001000 S _i
52 00000fb3 T _the_function
53 00000fa9 t _the_hidden_function
54 00000fa4 T _the_used_function
55 00000fae T _the_visible_function
56 """)
57 CheckNsyms(OutPath('single_exe'),
58 """\
59 00001000 T __mh_execute_header
60 """)
61
62 CheckNsyms(test.built_file_path(
63 'bundle_dylib.framework/Versions/A/bundle_dylib', chdir=CHDIR),
64 """\
65 00001000 S _i
66 00000fb3 T _the_function
67 00000fa9 t _the_hidden_function
68 00000fa4 T _the_used_function
69 00000fae T _the_visible_function
70 """)
71 CheckNsyms(test.built_file_path(
72 'bundle_so.bundle/Contents/MacOS/bundle_so', chdir=CHDIR),
73 """\
74 00001000 S _i
75 00000fb3 T _the_function
76 00000fa4 T _the_used_function
77 00000fae T _the_visible_function
78 """)
79 CheckNsyms(test.built_file_path(
80 'bundle_exe.app/Contents/MacOS/bundle_exe', chdir=CHDIR),
81 """\
82 00001000 T __mh_execute_header
83 """)
84
85 test.pass_test()
OLDNEW
« no previous file with comments | « test/mac/gyptest-strip.py ('k') | test/mac/strip/file.c » ('j') | test/mac/strip/file.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698