~hjd/ubuntu/wily/gyp/debian-merged

« back to all changes in this revision

Viewing changes to test/make_global_settings/full-toolchain/gyptest-make_global_settings.py

  • Committer: Hans Joachim Desserud
  • Date: 2015-10-31 12:46:59 UTC
  • mfrom: (6.2.6 sid)
  • Revision ID: hans_joachim_desserud-20151031124659-lzxekr6woskh4k0b
Merge latest Debian version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
# Copyright (c) 2014 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 make_global_settings works with the full toolchain.
 
9
"""
 
10
 
 
11
import os
 
12
import sys
 
13
import TestGyp
 
14
 
 
15
if sys.platform == 'win32':
 
16
  # cross compiling not supported by ninja on windows
 
17
  # and make not supported on windows at all.
 
18
  sys.exit(0)
 
19
 
 
20
test = TestGyp.TestGyp(formats=['ninja'])
 
21
# Must set the test format to something with a flavor (the part after the '-')
 
22
# in order to test the desired behavior. Since we want to run a non-host
 
23
# toolchain, we have to set the flavor to something that the ninja generator
 
24
# doesn't know about, so it doesn't default to the host-specific tools (e.g.,
 
25
# 'otool' on mac to generate the .TOC).
 
26
#
 
27
# Note that we can't just pass format=['ninja-some_toolchain'] to the
 
28
# constructor above, because then this test wouldn't be recognized as a ninja
 
29
# format test.
 
30
test.formats = ['ninja-my_flavor' if f == 'ninja' else f for f in test.formats]
 
31
 
 
32
gyp_file = 'make_global_settings.gyp'
 
33
 
 
34
test.run_gyp(gyp_file,
 
35
             # Teach the .gyp file about the location of my_nm.py and
 
36
             # my_readelf.py, and the python executable.
 
37
             '-Dworkdir=%s' % test.workdir,
 
38
             '-Dpython=%s' % sys.executable)
 
39
test.build(gyp_file,
 
40
           arguments=['-v'] if test.format == 'ninja-my_flavor' else [])
 
41
 
 
42
expected = ['MY_CC', 'MY_CXX']
 
43
test.must_contain_all_lines(test.stdout(), expected)
 
44
 
 
45
test.must_contain(test.built_file_path('RAN_MY_NM'), 'RAN_MY_NM')
 
46
test.must_contain(test.built_file_path('RAN_MY_READELF'), 'RAN_MY_READELF')
 
47
 
 
48
test.pass_test()