summaryrefslogtreecommitdiff
path: root/deps/gyp/test/variables/commands/repeated_multidir
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/variables/commands/repeated_multidir')
-rw-r--r--deps/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp13
-rw-r--r--deps/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp13
-rw-r--r--deps/gyp/test/variables/commands/repeated_multidir/main.gyp16
-rwxr-xr-xdeps/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py10
-rw-r--r--deps/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi25
5 files changed, 77 insertions, 0 deletions
diff --git a/deps/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp b/deps/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp
new file mode 100644
index 0000000000..328fc306cd
--- /dev/null
+++ b/deps/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp
@@ -0,0 +1,13 @@
+# Copyright 2014 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': {
+ 'expected_value': 'dir_1',
+ 'target_name': 'target_1',
+ },
+ 'includes': [
+ '../repeated_command_common.gypi',
+ ],
+}
diff --git a/deps/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp b/deps/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp
new file mode 100644
index 0000000000..18e0c62c93
--- /dev/null
+++ b/deps/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp
@@ -0,0 +1,13 @@
+# Copyright 2014 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': {
+ 'expected_value': 'dir_2',
+ 'target_name': 'target_2',
+ },
+ 'includes': [
+ '../repeated_command_common.gypi',
+ ],
+}
diff --git a/deps/gyp/test/variables/commands/repeated_multidir/main.gyp b/deps/gyp/test/variables/commands/repeated_multidir/main.gyp
new file mode 100644
index 0000000000..5beeeb7244
--- /dev/null
+++ b/deps/gyp/test/variables/commands/repeated_multidir/main.gyp
@@ -0,0 +1,16 @@
+# Copyright 2014 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': 'main',
+ 'type': 'none',
+ 'dependencies': [
+ 'dir_1/test_1.gyp:target_1',
+ 'dir_2/test_2.gyp:target_2',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py b/deps/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py
new file mode 100755
index 0000000000..ace9ed6b80
--- /dev/null
+++ b/deps/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+# Copyright 2014 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.
+
+import os
+import os.path
+
+print os.path.basename(os.getcwd())
diff --git a/deps/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi b/deps/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi
new file mode 100644
index 0000000000..74366771aa
--- /dev/null
+++ b/deps/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi
@@ -0,0 +1,25 @@
+# Copyright 2014 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': {
+ # This command will be run from the directories of the .gyp files that
+ # include this .gypi, the subdirectories dir_1 and dir_2, so use a
+ # relative path from those directories to the script.
+ 'observed_value': '<!(python ../print_cwd_basename.py)',
+ },
+ 'targets': [
+ {
+ 'target_name': '<(target_name)',
+ 'type': 'none',
+ 'conditions': [
+ ['observed_value != expected_value', {
+ # Attempt to expand an undefined variable. This triggers a GYP
+ # error.
+ 'assertion': '<(observed_value_must_equal_expected_value)',
+ }],
+ ],
+ },
+ ],
+}