summaryrefslogtreecommitdiff
path: root/deps/gyp/test/defines
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/defines')
-rw-r--r--deps/gyp/test/defines/defines-env.gyp22
-rw-r--r--deps/gyp/test/defines/defines.c23
-rw-r--r--deps/gyp/test/defines/defines.gyp38
-rwxr-xr-xdeps/gyp/test/defines/gyptest-define-override.py43
-rwxr-xr-xdeps/gyp/test/defines/gyptest-defines-env-regyp.py51
-rwxr-xr-xdeps/gyp/test/defines/gyptest-defines-env.py85
-rwxr-xr-xdeps/gyp/test/defines/gyptest-defines.py39
7 files changed, 0 insertions, 301 deletions
diff --git a/deps/gyp/test/defines/defines-env.gyp b/deps/gyp/test/defines/defines-env.gyp
deleted file mode 100644
index 1781546ae0..0000000000
--- a/deps/gyp/test/defines/defines-env.gyp
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (c) 2009 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.
-
-{
- 'variables': {
- 'value%': '5',
- },
- 'targets': [
- {
- 'target_name': 'defines',
- 'type': 'executable',
- 'sources': [
- 'defines.c',
- ],
- 'defines': [
- 'VALUE=<(value)',
- ],
- },
- ],
-}
-
diff --git a/deps/gyp/test/defines/defines.c b/deps/gyp/test/defines/defines.c
deleted file mode 100644
index dda139275d..0000000000
--- a/deps/gyp/test/defines/defines.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Copyright (c) 2011 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. */
-
-#include <stdio.h>
-
-int main(void)
-{
-#ifdef FOO
- printf("FOO is defined\n");
-#endif
- printf("VALUE is %d\n", VALUE);
-
-#ifdef PAREN_VALUE
- printf("2*PAREN_VALUE is %d\n", 2*PAREN_VALUE);
-#endif
-
-#ifdef HASH_VALUE
- printf("HASH_VALUE is %s\n", HASH_VALUE);
-#endif
-
- return 0;
-}
diff --git a/deps/gyp/test/defines/defines.gyp b/deps/gyp/test/defines/defines.gyp
deleted file mode 100644
index 90a755eb84..0000000000
--- a/deps/gyp/test/defines/defines.gyp
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 2009 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.
-
-{
- 'targets': [
- {
- 'target_name': 'defines',
- 'type': 'executable',
- 'sources': [
- 'defines.c',
- ],
- 'defines': [
- 'FOO',
- 'VALUE=1',
- 'PAREN_VALUE=(1+2+3)',
- 'HASH_VALUE="a#1"',
- ],
- },
- ],
- 'conditions': [
- ['OS=="fakeos"', {
- 'targets': [
- {
- 'target_name': 'fakeosprogram',
- 'type': 'executable',
- 'sources': [
- 'defines.c',
- ],
- 'defines': [
- 'FOO',
- 'VALUE=1',
- ],
- },
- ],
- }],
- ],
-}
diff --git a/deps/gyp/test/defines/gyptest-define-override.py b/deps/gyp/test/defines/gyptest-define-override.py
deleted file mode 100755
index 9730455b67..0000000000
--- a/deps/gyp/test/defines/gyptest-define-override.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2009 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 that a default gyp define can be overridden.
-"""
-
-import os
-import TestGyp
-
-test = TestGyp.TestGyp()
-
-# CMake loudly warns about passing '#' to the compiler and drops the define.
-expect_stderr = ''
-if test.format == 'cmake':
- expect_stderr = (
-"""WARNING: Preprocessor definitions containing '#' may not be passed on the"""
-""" compiler command line because many compilers do not support it.\n"""
-"""CMake is dropping a preprocessor definition: HASH_VALUE="a#1"\n"""
-"""Consider defining the macro in a (configured) header file.\n\n""")
-
-# Command-line define
-test.run_gyp('defines.gyp', '-D', 'OS=fakeos')
-test.build('defines.gyp', stderr=expect_stderr)
-test.built_file_must_exist('fakeosprogram', type=test.EXECUTABLE)
-# Clean up the exe so subsequent tests don't find an old exe.
-os.remove(test.built_file_path('fakeosprogram', type=test.EXECUTABLE))
-
-# Without "OS" override, fokeosprogram shouldn't be built.
-test.run_gyp('defines.gyp')
-test.build('defines.gyp', stderr=expect_stderr)
-test.built_file_must_not_exist('fakeosprogram', type=test.EXECUTABLE)
-
-# Environment define
-os.environ['GYP_DEFINES'] = 'OS=fakeos'
-test.run_gyp('defines.gyp')
-test.build('defines.gyp', stderr=expect_stderr)
-test.built_file_must_exist('fakeosprogram', type=test.EXECUTABLE)
-
-test.pass_test()
diff --git a/deps/gyp/test/defines/gyptest-defines-env-regyp.py b/deps/gyp/test/defines/gyptest-defines-env-regyp.py
deleted file mode 100755
index f2d931c2f7..0000000000
--- a/deps/gyp/test/defines/gyptest-defines-env-regyp.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2012 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 build of an executable with C++ define specified by a gyp define, and
-the use of the environment during regeneration when the gyp file changes.
-"""
-
-import os
-import TestGyp
-
-# Regenerating build files when a gyp file changes is currently only supported
-# by the make generator.
-test = TestGyp.TestGyp(formats=['make'])
-
-try:
- os.environ['GYP_DEFINES'] = 'value=50'
- test.run_gyp('defines.gyp')
-finally:
- # We clear the environ after calling gyp. When the auto-regeneration happens,
- # the same define should be reused anyway. Reset to empty string first in
- # case the platform doesn't support unsetenv.
- os.environ['GYP_DEFINES'] = ''
- del os.environ['GYP_DEFINES']
-
-test.build('defines.gyp')
-
-expect = """\
-FOO is defined
-VALUE is 1
-2*PAREN_VALUE is 12
-HASH_VALUE is a#1
-"""
-test.run_built_executable('defines', stdout=expect)
-
-# Sleep so that the changed gyp file will have a newer timestamp than the
-# previously generated build files.
-test.sleep()
-test.write('defines.gyp', test.read('defines-env.gyp'))
-
-test.build('defines.gyp', test.ALL)
-
-expect = """\
-VALUE is 50
-"""
-test.run_built_executable('defines', stdout=expect)
-
-test.pass_test()
diff --git a/deps/gyp/test/defines/gyptest-defines-env.py b/deps/gyp/test/defines/gyptest-defines-env.py
deleted file mode 100755
index 6b4e7175a6..0000000000
--- a/deps/gyp/test/defines/gyptest-defines-env.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2009 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 build of an executable with C++ define specified by a gyp define.
-"""
-
-import os
-import TestGyp
-
-test = TestGyp.TestGyp()
-
-# With the value only given in environment, it should be used.
-try:
- os.environ['GYP_DEFINES'] = 'value=10'
- test.run_gyp('defines-env.gyp')
-finally:
- del os.environ['GYP_DEFINES']
-
-test.build('defines-env.gyp')
-
-expect = """\
-VALUE is 10
-"""
-test.run_built_executable('defines', stdout=expect)
-
-
-# With the value given in both command line and environment,
-# command line should take precedence.
-try:
- os.environ['GYP_DEFINES'] = 'value=20'
- test.run_gyp('defines-env.gyp', '-Dvalue=25')
-finally:
- del os.environ['GYP_DEFINES']
-
-test.sleep()
-test.touch('defines.c')
-test.build('defines-env.gyp')
-
-expect = """\
-VALUE is 25
-"""
-test.run_built_executable('defines', stdout=expect)
-
-
-# With the value only given in environment, it should be ignored if
-# --ignore-environment is specified.
-try:
- os.environ['GYP_DEFINES'] = 'value=30'
- test.run_gyp('defines-env.gyp', '--ignore-environment')
-finally:
- del os.environ['GYP_DEFINES']
-
-test.sleep()
-test.touch('defines.c')
-test.build('defines-env.gyp')
-
-expect = """\
-VALUE is 5
-"""
-test.run_built_executable('defines', stdout=expect)
-
-
-# With the value given in both command line and environment, and
-# --ignore-environment also specified, command line should still be used.
-try:
- os.environ['GYP_DEFINES'] = 'value=40'
- test.run_gyp('defines-env.gyp', '--ignore-environment', '-Dvalue=45')
-finally:
- del os.environ['GYP_DEFINES']
-
-test.sleep()
-test.touch('defines.c')
-test.build('defines-env.gyp')
-
-expect = """\
-VALUE is 45
-"""
-test.run_built_executable('defines', stdout=expect)
-
-
-test.pass_test()
diff --git a/deps/gyp/test/defines/gyptest-defines.py b/deps/gyp/test/defines/gyptest-defines.py
deleted file mode 100755
index 77a3af53b9..0000000000
--- a/deps/gyp/test/defines/gyptest-defines.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2011 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 build of an executable with C++ defines.
-"""
-
-import TestGyp
-
-test = TestGyp.TestGyp()
-
-test.run_gyp('defines.gyp')
-
-expect = """\
-FOO is defined
-VALUE is 1
-2*PAREN_VALUE is 12
-"""
-
-#CMake loudly warns about passing '#' to the compiler and drops the define.
-expect_stderr = ''
-if test.format == 'cmake':
- expect_stderr = (
-"""WARNING: Preprocessor definitions containing '#' may not be passed on the"""
-""" compiler command line because many compilers do not support it.\n"""
-"""CMake is dropping a preprocessor definition: HASH_VALUE="a#1"\n"""
-"""Consider defining the macro in a (configured) header file.\n\n""")
-else:
- expect += """HASH_VALUE is a#1
-"""
-
-test.build('defines.gyp', stderr=expect_stderr)
-
-test.run_built_executable('defines', stdout=expect)
-
-test.pass_test()