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

« back to all changes in this revision

Viewing changes to mozc_build_tools/gyp/test/generator-output/gyptest-actions.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
Verifies --generator-output= behavior when using actions.
 
9
"""
 
10
 
 
11
import TestGyp
 
12
 
 
13
test = TestGyp.TestGyp()
 
14
 
 
15
# All the generated files should go under 'gypfiles'. The source directory
 
16
# ('actions') should be untouched.
 
17
test.writable(test.workpath('actions'), False)
 
18
test.run_gyp('actions.gyp',
 
19
             '--generator-output=' + test.workpath('gypfiles'),
 
20
             chdir='actions')
 
21
 
 
22
test.writable(test.workpath('actions'), True)
 
23
 
 
24
test.relocate('actions', 'relocate/actions')
 
25
test.relocate('gypfiles', 'relocate/gypfiles')
 
26
 
 
27
test.writable(test.workpath('relocate/actions'), False)
 
28
 
 
29
# Some of the action outputs use "pure" relative paths (i.e. without prefixes
 
30
# like <(INTERMEDIATE_DIR) or <(PROGRAM_DIR)). Even though we are building under
 
31
# 'gypfiles', such outputs will still be created relative to the original .gyp
 
32
# sources. Projects probably wouldn't normally do this, since it kind of defeats
 
33
# the purpose of '--generator-output', but it is supported behaviour.
 
34
test.writable(test.workpath('relocate/actions/build'), True)
 
35
test.writable(test.workpath('relocate/actions/subdir1/build'), True)
 
36
test.writable(test.workpath('relocate/actions/subdir1/actions-out'), True)
 
37
test.writable(test.workpath('relocate/actions/subdir2/build'), True)
 
38
test.writable(test.workpath('relocate/actions/subdir2/actions-out'), True)
 
39
 
 
40
test.build('actions.gyp', test.ALL, chdir='relocate/gypfiles')
 
41
 
 
42
expect = """\
 
43
Hello from program.c
 
44
Hello from make-prog1.py
 
45
Hello from make-prog2.py
 
46
"""
 
47
 
 
48
if test.format == 'xcode':
 
49
  chdir = 'relocate/actions/subdir1'
 
50
else:
 
51
  chdir = 'relocate/gypfiles'
 
52
test.run_built_executable('program', chdir=chdir, stdout=expect)
 
53
 
 
54
test.must_match('relocate/actions/subdir2/actions-out/file.out',
 
55
                "Hello from make-file.py\n")
 
56
 
 
57
test.pass_test()