Sha256: 4523cd2b641c297d113fc2f066e2d411e2a3eda1f4e465a88600f8751fb58a46

Contents?: true

Size: 1.5 KB

Versions: 23

Compression:

Stored size: 1.5 KB

Contents

#!/usr/bin/env python

# Copyright (c) 2012 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 stripping works.
"""

import TestGyp

import re
import subprocess
import sys
import time

if sys.platform == 'darwin':
  test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])

  test.run_gyp('test.gyp', chdir='strip')

  test.build('test.gyp', test.ALL, chdir='strip')

  # Lightweight check if stripping was done.
  def OutPath(s):
    return test.built_file_path(s, type=test.SHARED_LIB, chdir='strip')

  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
    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 make build.
  CheckNsyms(OutPath('no_postprocess'), 11)
  CheckNsyms(OutPath('no_strip'), 11)
  CheckNsyms(OutPath('strip_all'), 0)
  CheckNsyms(OutPath('strip_nonglobal'), 2)
  CheckNsyms(OutPath('strip_debugging'), 3)
  CheckNsyms(OutPath('strip_all_custom_flags'), 0)
  CheckNsyms(test.built_file_path(
      'strip_all_bundle.framework/Versions/A/strip_all_bundle', chdir='strip'),
      0)
  CheckNsyms(OutPath('strip_save'), 3)

  test.pass_test()

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
libv8-3.16.14.19.1 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.19 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.18 vendor/gyp/test/mac/gyptest-strip.py
arcabouco-0.2.13 vendor/bundle/gems/libv8-3.16.14.17/vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.17 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.16 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.15 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.14 vendor/gyp/test/mac/gyptest-strip.py
libv8-tmpfork-3.16.14.13 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.13 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.12 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.11 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.10 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.8 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.8.rc1 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.7 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.6 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.5 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.4 vendor/gyp/test/mac/gyptest-strip.py
libv8-3.16.14.3 vendor/gyp/test/mac/gyptest-strip.py