Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: test/gyp-defines/gyptest-multiple-values.py

Issue 421453003: Add TestGypXcodeNinja to run tests against the xcode-ninja generator (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase onto origin/master Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2012 Google Inc. All rights reserved. 3 # Copyright (c) 2012 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ 7 """
8 Verifies that when multiple values are supplied for a gyp define, the last one 8 Verifies that when multiple values are supplied for a gyp define, the last one
9 is used. 9 is used.
10 """ 10 """
11 11
12 import os 12 import os
13 import TestGyp 13 import TestGyp
14 14
15 test = TestGyp.TestGyp() 15 test = TestGyp.TestGyp()
16 16
17 os.environ['GYP_DEFINES'] = 'key=value1 key=value2 key=value3' 17 os.environ['GYP_DEFINES'] = 'key=value1 key=value2 key=value3'
18 test.run_gyp('defines.gyp') 18 test.run_gyp('defines.gyp',
19 '-G', 'xcode_ninja_target_pattern=^test_target$')
20
19 test.build('defines.gyp') 21 test.build('defines.gyp')
20 test.must_contain('action.txt', 'value3') 22 test.must_contain('action.txt', 'value3')
21 23
22 # The last occurrence of a repeated set should take precedence over other 24 # The last occurrence of a repeated set should take precedence over other
23 # values. 25 # values.
24 os.environ['GYP_DEFINES'] = 'key=repeated_value key=value1 key=repeated_value' 26 os.environ['GYP_DEFINES'] = 'key=repeated_value key=value1 key=repeated_value'
25 test.run_gyp('defines.gyp') 27 test.run_gyp('defines.gyp',
28 '-G', 'xcode_ninja_target_pattern=^test_target$')
29
26 if test.format == 'msvs' and not test.uses_msbuild: 30 if test.format == 'msvs' and not test.uses_msbuild:
27 # msvs versions before 2010 don't detect build rule changes not reflected 31 # msvs versions before 2010 don't detect build rule changes not reflected
28 # in file system timestamps. Rebuild to see differences. 32 # in file system timestamps. Rebuild to see differences.
29 test.build('defines.gyp', rebuild=True) 33 test.build('defines.gyp', rebuild=True)
30 elif test.format == 'android': 34 elif test.format == 'android':
31 # The Android build system doesn't currently have a way to get files whose 35 # The Android build system doesn't currently have a way to get files whose
32 # build rules have changed (but whose timestamps haven't) to be rebuilt. 36 # build rules have changed (but whose timestamps haven't) to be rebuilt.
33 # See bug http://code.google.com/p/gyp/issues/detail?id=308 37 # See bug http://code.google.com/p/gyp/issues/detail?id=308
34 test.unlink('action.txt') 38 test.unlink('action.txt')
35 test.build('defines.gyp') 39 test.build('defines.gyp')
36 else: 40 else:
37 test.build('defines.gyp') 41 test.build('defines.gyp')
38 test.must_contain('action.txt', 'repeated_value') 42 test.must_contain('action.txt', 'repeated_value')
39 43
40 test.pass_test() 44 test.pass_test()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698