• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2
3# Copyright (c) 2009 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"""
8Verifies that toolsets are correctly applied
9"""
10import os
11import sys
12import TestGyp
13
14if sys.platform.startswith('linux'):
15
16  test = TestGyp.TestGyp(formats=['make', 'ninja'])
17
18  oldenv = os.environ.copy()
19  try:
20    os.environ['GYP_CROSSCOMPILE'] = '1'
21    test.run_gyp('toolsets.gyp')
22  finally:
23    os.environ.clear()
24    os.environ.update(oldenv)
25
26  test.build('toolsets.gyp', test.ALL)
27
28  test.run_built_executable('host-main', stdout="Host\nShared: Host\n")
29  test.run_built_executable('target-main', stdout="Target\nShared: Target\n")
30
31  test.pass_test()
32