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

« back to all changes in this revision

Viewing changes to mozc_build_tools/gyp/test/defines/gyptest-defines-env-regyp.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 build of an executable with C++ define specified by a gyp define, and
 
9
the use of the environment during regeneration when the gyp file changes.
 
10
"""
 
11
 
 
12
import os
 
13
import TestGyp
 
14
 
 
15
# Regenerating build files when a gyp file changes is currently only supported
 
16
# by the make generator.
 
17
test = TestGyp.TestGyp(formats=['make'])
 
18
 
 
19
try:
 
20
  os.environ['GYP_DEFINES'] = 'value=50'
 
21
  test.run_gyp('defines.gyp')
 
22
finally:
 
23
  # We clear the environ after calling gyp.  When the auto-regeneration happens,
 
24
  # the same define should be reused anyway.  Reset to empty string first in
 
25
  # case the platform doesn't support unsetenv.
 
26
  os.environ['GYP_DEFINES'] = ''
 
27
  del os.environ['GYP_DEFINES']
 
28
 
 
29
test.build('defines.gyp')
 
30
 
 
31
expect = """\
 
32
FOO is defined
 
33
VALUE is 1
 
34
"""
 
35
test.run_built_executable('defines', stdout=expect)
 
36
 
 
37
# Sleep so that the changed gyp file will have a newer timestamp than the
 
38
# previously generated build files.
 
39
test.sleep()
 
40
test.write('defines.gyp', test.read('defines-env.gyp'))
 
41
 
 
42
test.build('defines.gyp', test.ALL)
 
43
 
 
44
expect = """\
 
45
VALUE is 50
 
46
"""
 
47
test.run_built_executable('defines', stdout=expect)
 
48
 
 
49
test.pass_test()