~ubuntu-branches/ubuntu/oneiric/mozc/oneiric

« back to all changes in this revision

Viewing changes to third_party/gyp/test/builddir/gyptest-all.py

  • Committer: Bazaar Package Importer
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2010-07-14 03:26:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100714032647-13qjisj6m8cm8jdx
Tags: 0.12.410.102-1
* New upstream release (Closes: #588971).
  - Add mozc-server, mozc-utils-gui and scim-mozc packages.
* Update debian/rules.
  Add --gypdir option to build_mozc.py.
* Update debian/control.
  - Bumped standards-version to 3.9.0.
  - Update description.
* Add mozc icon (Closes: #588972).
* Add patch which revises issue 18.
  ibus_mozc_issue18.patch
* kFreeBSD build support.
  support_kfreebsd.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
"""
 
8
Verify the settings that cause a set of programs to be created in
 
9
a specific build directory, and that no intermediate built files
 
10
get created outside of that build directory hierarchy even when
 
11
referred to with deeply-nested ../../.. paths.
 
12
"""
 
13
 
 
14
import TestGyp
 
15
 
 
16
# TODO(mmoss): Make only supports (theoretically) a single, global build
 
17
# directory (through GYP_GENERATOR_FLAGS 'output_dir'), rather than
 
18
# gyp-file-specific settings (e.g. the stuff in builddir.gypi) that the other
 
19
# generators support, so this doesn't work yet for make.
 
20
# TODO(mmoss) Make also has the issue that the top-level Makefile is written to
 
21
# the "--depth" location, which is one level above 'src', but then this test
 
22
# moves 'src' somewhere else, leaving the Makefile behind, so make can't find
 
23
# its sources. I'm not sure if make is wrong for writing outside the current
 
24
# directory, or if the test is wrong for assuming everything generated is under
 
25
# the current directory.
 
26
test = TestGyp.TestGyp(formats=['!make'])
 
27
 
 
28
test.run_gyp('prog1.gyp', '--depth=..', chdir='src')
 
29
 
 
30
test.relocate('src', 'relocate/src')
 
31
 
 
32
test.subdir('relocate/builddir')
 
33
 
 
34
# Make sure that all the built ../../etc. files only get put under builddir,
 
35
# by making all of relocate read-only and then making only builddir writable.
 
36
test.writable('relocate', False)
 
37
test.writable('relocate/builddir', True)
 
38
 
 
39
# Suppress the test infrastructure's setting SYMROOT on the command line.
 
40
test.build('prog1.gyp', test.ALL, SYMROOT=None, chdir='relocate/src')
 
41
 
 
42
expect1 = """\
 
43
Hello from prog1.c
 
44
Hello from func1.c
 
45
"""
 
46
 
 
47
expect2 = """\
 
48
Hello from subdir2/prog2.c
 
49
Hello from func2.c
 
50
"""
 
51
 
 
52
expect3 = """\
 
53
Hello from subdir2/subdir3/prog3.c
 
54
Hello from func3.c
 
55
"""
 
56
 
 
57
expect4 = """\
 
58
Hello from subdir2/subdir3/subdir4/prog4.c
 
59
Hello from func4.c
 
60
"""
 
61
 
 
62
expect5 = """\
 
63
Hello from subdir2/subdir3/subdir4/subdir5/prog5.c
 
64
Hello from func5.c
 
65
"""
 
66
 
 
67
def run_builddir(prog, expect):
 
68
  dir = 'relocate/builddir/Default/'
 
69
  test.run(program=test.workpath(dir + prog), stdout=expect)
 
70
 
 
71
run_builddir('prog1', expect1)
 
72
run_builddir('prog2', expect2)
 
73
run_builddir('prog3', expect3)
 
74
run_builddir('prog4', expect4)
 
75
run_builddir('prog5', expect5)
 
76
 
 
77
test.pass_test()