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

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):
Mark Mentovai 2013/09/13 21:31:32 This is not checking nsyms now, it’s checking syms
31 proc = subprocess.Popen(['nm', '-a', p], stdout=subprocess.PIPE)
32 o = proc.communicate()[0]
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 00000fb3 T _the_function
Mark Mentovai 2013/09/13 21:31:32 The numbers here will vary depending on the compil
44 00000fa9 t _the_hidden_function
45 00000fa4 T _the_used_function
46 00000fae T _the_visible_function
47 U dyld_stub_binder
48 """)
49 CheckNsyms(OutPath('single_so.so'),
50 """\
51 00000fb3 T _the_function
52 00000fa9 t _the_hidden_function
53 00000fa4 T _the_used_function
54 00000fae T _the_visible_function
55 U dyld_stub_binder
56 """)
57 CheckNsyms(OutPath('single_exe'),
58 """\
59 00001000 T __mh_execute_header
60 U dyld_stub_binder
61 """)
62
63 CheckNsyms(test.built_file_path(
64 'bundle_dylib.framework/Versions/A/bundle_dylib', chdir=CHDIR),
65 """\
66 00000fb3 T _the_function
67 00000fa9 t _the_hidden_function
68 00000fa4 T _the_used_function
69 00000fae T _the_visible_function
70 U dyld_stub_binder
71 """)
72 CheckNsyms(test.built_file_path(
73 'bundle_so.bundle/Contents/MacOS/bundle_so', chdir=CHDIR),
74 """\
75 00000fb3 T _the_function
76 00000fa4 T _the_used_function
77 00000fae T _the_visible_function
78 U dyld_stub_binder
79 """)
80 CheckNsyms(test.built_file_path(
81 'bundle_exe.app/Contents/MacOS/bundle_exe', chdir=CHDIR),
82 """\
83 00001000 T __mh_execute_header
84 U dyld_stub_binder
85 """)
86
87 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698