summaryrefslogtreecommitdiff
path: root/deps/gyp/test/make_global_settings/env-wrapper
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/make_global_settings/env-wrapper
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/make_global_settings/env-wrapper')
-rw-r--r--deps/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py46
-rw-r--r--deps/gyp/test/make_global_settings/env-wrapper/wrapper.gyp17
2 files changed, 63 insertions, 0 deletions
diff --git a/deps/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py b/deps/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py
new file mode 100644
index 0000000000..70d6906cca
--- /dev/null
+++ b/deps/gyp/test/make_global_settings/env-wrapper/gyptest-wrapper.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies *_wrapper in environment.
+"""
+
+import os
+import sys
+import TestGyp
+
+test_format = ['ninja']
+
+os.environ['CC_wrapper'] = 'distcc'
+os.environ['LINK_wrapper'] = 'distlink'
+os.environ['CC.host_wrapper'] = 'ccache'
+
+test = TestGyp.TestGyp(formats=test_format)
+
+old_env = dict(os.environ)
+os.environ['GYP_CROSSCOMPILE'] = '1'
+test.run_gyp('wrapper.gyp')
+os.environ.clear()
+os.environ.update(old_env)
+
+if test.format == 'ninja':
+ cc_expected = ('cc = ' + os.path.join('..', '..', 'distcc') + ' ' +
+ os.path.join('..', '..', 'clang'))
+ cc_host_expected = ('cc_host = ' + os.path.join('..', '..', 'ccache') + ' ' +
+ os.path.join('..', '..', 'clang'))
+ ld_expected = 'ld = ../../distlink $cc'
+ if sys.platform != 'win32':
+ ldxx_expected = 'ldxx = ../../distlink $cxx'
+
+ if sys.platform == 'win32':
+ ld_expected = 'link.exe'
+ test.must_contain('out/Default/build.ninja', cc_expected)
+ test.must_contain('out/Default/build.ninja', cc_host_expected)
+ test.must_contain('out/Default/build.ninja', ld_expected)
+ if sys.platform != 'win32':
+ test.must_contain('out/Default/build.ninja', ldxx_expected)
+
+test.pass_test()
diff --git a/deps/gyp/test/make_global_settings/env-wrapper/wrapper.gyp b/deps/gyp/test/make_global_settings/env-wrapper/wrapper.gyp
new file mode 100644
index 0000000000..1698d71dd4
--- /dev/null
+++ b/deps/gyp/test/make_global_settings/env-wrapper/wrapper.gyp
@@ -0,0 +1,17 @@
+# Copyright (c) 2013 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'make_global_settings': [
+ ['CC', 'clang'],
+ ['CC.host', 'clang'],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'test',
+ 'type': 'static_library',
+ 'sources': [ 'foo.c' ],
+ },
+ ],
+}