Sha256: 2b0506d33ff747fee0d8313ed90e0ed7bf19658b00535b8c7ea14d45a244e278

Contents?: true

Size: 1.37 KB

Versions: 23

Compression:

Stored size: 1.37 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 make_global_settings can be used to override the
compiler settings.
"""

import TestGyp
import os
import copy
import sys
from string import Template


if sys.platform == 'win32':
  # cross compiling not support by ninja on windows
  # and make not supported on windows at all.
  sys.exit(0)

test = TestGyp.TestGyp(formats=['ninja', 'make'])

gypfile = 'compiler-global-settings.gyp'

replacements = { 'PYTHON': '/usr/bin/python', 'PWD': os.getcwd()}

# Process the .in gyp file to produce the final gyp file
# since we need to include absolute paths in the make_global_settings
# section.
replacements['TOOLSET'] = 'target'
s = Template(open(gypfile + '.in').read())
output = open(gypfile, 'w')
output.write(s.substitute(replacements))
output.close()

test.run_gyp(gypfile)
test.build(gypfile)
test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'FOO'])

# Same again but with the host toolset.
replacements['TOOLSET'] = 'host'
s = Template(open(gypfile + '.in').read())
output = open(gypfile, 'w')
output.write(s.substitute(replacements))
output.close()

test.run_gyp(gypfile)
test.build(gypfile)
test.must_contain_all_lines(test.stdout(), ['my_cc.py', 'my_cxx.py', 'BAR'])

test.pass_test()

Version data entries

23 entries across 23 versions & 3 rubygems

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