Bug 797671: Import Webrtc.org code from stable branch 3.12 (rev 2820) rs=jesup
[gecko.git] / media / webrtc / trunk / tools / gyp / test / mac / gyptest-xcode-gcc.py
blob5f5de7608cc29d551f0a79d8891799ab12c7e2bd
1 #!/usr/bin/env python
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
5 # found in the LICENSE file.
7 """
8 Verifies that xcode-style GCC_... settings are handled properly.
9 """
11 import TestGyp
13 import sys
15 def IgnoreOutput(string, expected_string):
16 return True
18 if sys.platform == 'darwin':
19 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
21 CHDIR = 'xcode-gcc'
22 test.run_gyp('test.gyp', chdir=CHDIR)
24 # List of targets that'll pass. It expects targets of the same name with
25 # '-fail' appended that'll fail to build.
26 targets = [
27 'warn_about_invalid_offsetof_macro',
28 'warn_about_missing_newline',
31 for target in targets:
32 test.build('test.gyp', target, chdir=CHDIR)
33 test.built_file_must_exist(target, chdir=CHDIR)
34 fail_target = target + '-fail'
35 test.build('test.gyp', fail_target, chdir=CHDIR, status=None,
36 stderr=None, match=IgnoreOutput)
37 test.built_file_must_not_exist(fail_target, chdir=CHDIR)
39 test.pass_test()