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,85 @@ |
+#!/usr/bin/env python |
+ |
+# Copyright (c) 2013 Google Inc. All rights reserved. |
+# 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, o_expected): |
+ proc = subprocess.Popen(['nm', '-aU', p], stdout=subprocess.PIPE) |
+ o = proc.communicate()[0].replace('A', 'T') |
+ assert not proc.returncode |
+ if o != o_expected: |
+ print 'Stripping: Expected symbols """\n%s""", got """\n%s"""' % ( |
+ o_expected, o) |
+ 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'), |
+"""\ |
+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.
|
+00000fb3 T _the_function |
+00000fa9 t _the_hidden_function |
+00000fa4 T _the_used_function |
+00000fae T _the_visible_function |
+""") |
+ CheckNsyms(OutPath('single_so.so'), |
+"""\ |
+00001000 S _i |
+00000fb3 T _the_function |
+00000fa9 t _the_hidden_function |
+00000fa4 T _the_used_function |
+00000fae T _the_visible_function |
+""") |
+ CheckNsyms(OutPath('single_exe'), |
+"""\ |
+00001000 T __mh_execute_header |
+""") |
+ |
+ CheckNsyms(test.built_file_path( |
+ 'bundle_dylib.framework/Versions/A/bundle_dylib', chdir=CHDIR), |
+"""\ |
+00001000 S _i |
+00000fb3 T _the_function |
+00000fa9 t _the_hidden_function |
+00000fa4 T _the_used_function |
+00000fae T _the_visible_function |
+""") |
+ CheckNsyms(test.built_file_path( |
+ 'bundle_so.bundle/Contents/MacOS/bundle_so', chdir=CHDIR), |
+"""\ |
+00001000 S _i |
+00000fb3 T _the_function |
+00000fa4 T _the_used_function |
+00000fae T _the_visible_function |
+""") |
+ CheckNsyms(test.built_file_path( |
+ 'bundle_exe.app/Contents/MacOS/bundle_exe', chdir=CHDIR), |
+"""\ |
+00001000 T __mh_execute_header |
+""") |
+ |
+ test.pass_test() |
Property changes on: test/mac/gyptest-strip-default.py |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |