summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/mac/postbuilds
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/gyp/test/mac/postbuilds')
-rwxr-xr-xthird_party/python/gyp/test/mac/postbuilds/copy.sh3
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/file.c4
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/file_g.c4
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/file_h.c4
-rwxr-xr-xthird_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh23
-rwxr-xr-xthird_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh23
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt1
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp53
-rw-r--r--third_party/python/gyp/test/mac/postbuilds/test.gyp93
9 files changed, 208 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/mac/postbuilds/copy.sh b/third_party/python/gyp/test/mac/postbuilds/copy.sh
new file mode 100755
index 0000000000..ecad0381db
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/copy.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+cp "$@"
diff --git a/third_party/python/gyp/test/mac/postbuilds/file.c b/third_party/python/gyp/test/mac/postbuilds/file.c
new file mode 100644
index 0000000000..653e71ff7e
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/file.c
@@ -0,0 +1,4 @@
+// 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.
+void f() {}
diff --git a/third_party/python/gyp/test/mac/postbuilds/file_g.c b/third_party/python/gyp/test/mac/postbuilds/file_g.c
new file mode 100644
index 0000000000..0f7849d208
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/file_g.c
@@ -0,0 +1,4 @@
+// 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.
+void g() {}
diff --git a/third_party/python/gyp/test/mac/postbuilds/file_h.c b/third_party/python/gyp/test/mac/postbuilds/file_h.c
new file mode 100644
index 0000000000..521d1f4d56
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/file_h.c
@@ -0,0 +1,4 @@
+// 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.
+void h() {}
diff --git a/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh b/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh
new file mode 100755
index 0000000000..c623c8bf21
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# 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.
+
+set -e
+
+lib="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}"
+nm ${lib} > /dev/null # Just make sure this works.
+
+pattern="${1}"
+
+if [ $pattern != "a|b" ]; then
+ echo "Parameter quoting is broken"
+ exit 1
+fi
+
+if [ "${2}" != "arg with spaces" ]; then
+ echo "Parameter space escaping is broken"
+ exit 1
+fi
+
+touch "${lib}"_touch
diff --git a/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh b/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh
new file mode 100755
index 0000000000..2bf09b34e1
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+# 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.
+
+set -e
+
+lib="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}"
+nm ${lib} > /dev/null # Just make sure this works.
+
+pattern="${1}"
+
+if [ $pattern != "a|b" ]; then
+ echo "Parameter quote escaping is broken"
+ exit 1
+fi
+
+if [ "${2}" != "arg with spaces" ]; then
+ echo "Parameter space escaping is broken"
+ exit 1
+fi
+
+touch "${lib}"_touch.a
diff --git a/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt b/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt
new file mode 100644
index 0000000000..a634f85b6c
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt
@@ -0,0 +1 @@
+This file should be copied to the products dir.
diff --git a/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp b/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp
new file mode 100644
index 0000000000..6d4f2395e3
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp
@@ -0,0 +1,53 @@
+# 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.
+{
+ 'targets': [
+ {
+ 'target_name': 'nest_el',
+ 'type': 'static_library',
+ 'sources': [ '../file_g.c', ],
+ 'postbuilds': [
+ {
+ 'postbuild_name': 'Static library postbuild',
+ 'variables': {
+ 'some_regex': 'a|b',
+ },
+ 'action': [
+ '../script/static_library_postbuild.sh',
+ '<(some_regex)',
+ 'arg with spaces',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'nest_dyna',
+ 'type': 'shared_library',
+ 'mac_bundle': 1,
+ 'sources': [ '../file_h.c', ],
+ 'postbuilds': [
+ {
+ 'postbuild_name': 'Dynamic library postbuild',
+ 'variables': {
+ 'some_regex': 'a|b',
+ },
+ 'action': [
+ '../script/shared_library_postbuild.sh',
+ '<(some_regex)',
+ 'arg with spaces',
+ ],
+ },
+ {
+ 'postbuild_name': 'Test paths relative to gyp file',
+ 'action': [
+ '../copy.sh',
+ './copied_file.txt',
+ '${BUILT_PRODUCTS_DIR}/copied_file_2.txt',
+ ],
+ },
+ ],
+ },
+ ],
+}
+
diff --git a/third_party/python/gyp/test/mac/postbuilds/test.gyp b/third_party/python/gyp/test/mac/postbuilds/test.gyp
new file mode 100644
index 0000000000..7c0b523f86
--- /dev/null
+++ b/third_party/python/gyp/test/mac/postbuilds/test.gyp
@@ -0,0 +1,93 @@
+# 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.
+{
+ 'targets': [
+ {
+ 'target_name': 'el',
+ 'type': 'static_library',
+ 'sources': [ 'file.c', ],
+ 'postbuilds': [
+ {
+ 'postbuild_name': 'Static library postbuild',
+ 'variables': {
+ 'some_regex': 'a|b',
+ },
+ 'action': [
+ 'script/static_library_postbuild.sh',
+ '<(some_regex)',
+ 'arg with spaces',
+ ],
+ },
+ {
+ 'postbuild_name': 'Test variable in gyp file',
+ 'action': [
+ 'cp',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch.a',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'dyna',
+ 'type': 'shared_library',
+ 'mac_bundle': 1,
+ 'sources': [ 'file.c', ],
+ 'dependencies': [
+ 'subdirectory/nested_target.gyp:nest_dyna',
+ 'subdirectory/nested_target.gyp:nest_el',
+ ],
+ 'postbuilds': [
+ {
+ 'postbuild_name': 'Dynamic library postbuild',
+ 'variables': {
+ 'some_regex': 'a|b',
+ },
+ 'action': [
+ 'script/shared_library_postbuild.sh',
+ '<(some_regex)',
+ 'arg with spaces',
+ ],
+ },
+ {
+ 'postbuild_name': 'Test variable in gyp file',
+ 'action': [
+ 'cp',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch',
+ ],
+ },
+ {
+ 'postbuild_name': 'Test paths relative to gyp file',
+ 'action': [
+ './copy.sh',
+ 'subdirectory/copied_file.txt',
+ '${BUILT_PRODUCTS_DIR}',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'dyna_standalone',
+ 'type': 'shared_library',
+ 'sources': [ 'file.c', ],
+ 'postbuilds': [
+ {
+ 'postbuild_name': 'Test variable in gyp file',
+ 'action': [
+ 'cp',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}',
+ '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch.dylib',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'EmptyBundle',
+ 'product_extension': 'bundle',
+ 'type': 'executable',
+ 'mac_bundle': 1,
+ },
+ ],
+}