summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/toolsets/gyptest-toolsets.py
blob: f80fce70a2d0ab673f0d0b2a71067043ae4b592b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python

# Copyright (c) 2009 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 toolsets are correctly applied
"""
import os
import sys
import TestGyp

if sys.platform.startswith('linux'):

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

  oldenv = os.environ.copy()
  try:
    os.environ['GYP_CROSSCOMPILE'] = '1'
    test.run_gyp('toolsets.gyp')
  finally:
    os.environ.clear()
    os.environ.update(oldenv)

  test.build('toolsets.gyp', test.ALL)

  test.run_built_executable('host-main', stdout="Host\nShared: Host\n")
  test.run_built_executable('target-main', stdout="Target\nShared: Target\n")

  test.pass_test()