summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/self-dependency
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/self-dependency')
-rw-r--r--third_party/python/gyp/test/self-dependency/common.gypi13
-rw-r--r--third_party/python/gyp/test/self-dependency/dep.gyp23
-rwxr-xr-xthird_party/python/gyp/test/self-dependency/gyptest-self-dependency.py19
-rw-r--r--third_party/python/gyp/test/self-dependency/self_dependency.gyp15
4 files changed, 70 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/self-dependency/common.gypi b/third_party/python/gyp/test/self-dependency/common.gypi
new file mode 100644
index 0000000000..aae221a5dd
--- /dev/null
+++ b/third_party/python/gyp/test/self-dependency/common.gypi
@@ -0,0 +1,13 @@
+# 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.
+
+# A common file that other .gyp files include.
+# Makes every target in the project depend on dep.gyp:dep.
+{
+ 'target_defaults': {
+ 'dependencies': [
+ 'dep.gyp:dep',
+ ],
+ },
+}
diff --git a/third_party/python/gyp/test/self-dependency/dep.gyp b/third_party/python/gyp/test/self-dependency/dep.gyp
new file mode 100644
index 0000000000..2b6c9dda85
--- /dev/null
+++ b/third_party/python/gyp/test/self-dependency/dep.gyp
@@ -0,0 +1,23 @@
+# 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.
+
+# dep.gyp contains a target dep, on which all the targets in the project
+# depend. This means there's a self-dependency of dep on itself, which is
+# pruned by setting prune_self_dependency to 1.
+
+{
+ 'includes': [
+ 'common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'dep',
+ 'type': 'none',
+ 'variables': {
+ # Without this GYP will report a cycle in dependency graph.
+ 'prune_self_dependency': 1,
+ },
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/self-dependency/gyptest-self-dependency.py b/third_party/python/gyp/test/self-dependency/gyptest-self-dependency.py
new file mode 100755
index 0000000000..82fab271c5
--- /dev/null
+++ b/third_party/python/gyp/test/self-dependency/gyptest-self-dependency.py
@@ -0,0 +1,19 @@
+#!/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.
+
+"""
+Verify that pulling in a dependency a second time in a conditional works for
+shared_library targets. Regression test for http://crbug.com/122588
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('self_dependency.gyp')
+
+# If running gyp worked, all is well.
+test.pass_test()
diff --git a/third_party/python/gyp/test/self-dependency/self_dependency.gyp b/third_party/python/gyp/test/self-dependency/self_dependency.gyp
new file mode 100644
index 0000000000..0ca76c669b
--- /dev/null
+++ b/third_party/python/gyp/test/self-dependency/self_dependency.gyp
@@ -0,0 +1,15 @@
+# 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.
+
+{
+ 'includes': [
+ 'common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'a',
+ 'type': 'none',
+ },
+ ],
+}