• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2
3# Copyright (c) 2011 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 simple rules when using an explicit build target of 'all'.
9"""
10
11import TestGyp
12import os
13import sys
14
15if sys.platform == 'win32':
16  print "This test is currently disabled: https://crbug.com/483696."
17  sys.exit(0)
18
19
20test = TestGyp.TestGyp(formats=['make', 'ninja', 'xcode', 'msvs'])
21
22test.run_gyp('actions.gyp', chdir='src')
23
24test.relocate('src', 'relocate/src')
25
26test.build('actions.gyp', chdir='relocate/src')
27
28expect = """\
29no dir here
30hi c
31hello baz
32"""
33if test.format == 'xcode':
34  chdir = 'relocate/src/subdir'
35else:
36  chdir = 'relocate/src'
37test.run_built_executable('gencc_int_output', chdir=chdir, stdout=expect)
38if test.format == 'msvs':
39  test.run_built_executable('gencc_int_output_external', chdir=chdir,
40                            stdout=expect)
41
42test.must_match('relocate/src/subdir/foo/bar/baz.dirname',
43                os.path.join('foo', 'bar'))
44test.must_match('relocate/src/subdir/a/b/c.dirname',
45                os.path.join('a', 'b'))
46
47# FIXME the xcode and make generators incorrectly convert RULE_INPUT_PATH
48# to an absolute path, making the tests below fail!
49if test.format != 'xcode' and test.format != 'make':
50  test.must_match('relocate/src/subdir/foo/bar/baz.path',
51                  os.path.join('foo', 'bar', 'baz.printvars'))
52  test.must_match('relocate/src/subdir/a/b/c.path',
53                  os.path.join('a', 'b', 'c.printvars'))
54
55test.pass_test()
56