~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/ThirdParty/gyp/test/defines/gyptest-define-override.py

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

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 that a default gyp define can be overridden.
 
9
"""
 
10
 
 
11
import os
 
12
import TestGyp
 
13
 
 
14
test = TestGyp.TestGyp()
 
15
 
 
16
# Command-line define
 
17
test.run_gyp('defines.gyp', '-D', 'OS=fakeos')
 
18
test.build('defines.gyp')
 
19
test.built_file_must_exist('fakeosprogram', type=test.EXECUTABLE)
 
20
# Clean up the exe so subsequent tests don't find an old exe.
 
21
os.remove(test.built_file_path('fakeosprogram', type=test.EXECUTABLE))
 
22
 
 
23
# Without "OS" override, fokeosprogram shouldn't be built.
 
24
test.run_gyp('defines.gyp')
 
25
test.build('defines.gyp')
 
26
test.built_file_must_not_exist('fakeosprogram', type=test.EXECUTABLE)
 
27
 
 
28
# Environment define
 
29
os.environ['GYP_DEFINES'] = 'OS=fakeos'
 
30
test.run_gyp('defines.gyp')
 
31
test.build('defines.gyp')
 
32
test.built_file_must_exist('fakeosprogram', type=test.EXECUTABLE)
 
33
 
 
34
test.pass_test()