summaryrefslogtreecommitdiff
path: root/deps/gyp/test/copies
diff options
context:
space:
mode:
Diffstat (limited to 'deps/gyp/test/copies')
-rwxr-xr-xdeps/gyp/test/copies/gyptest-all.py42
-rw-r--r--deps/gyp/test/copies/gyptest-attribs.py41
-rwxr-xr-xdeps/gyp/test/copies/gyptest-default.py42
-rwxr-xr-xdeps/gyp/test/copies/gyptest-samedir.py28
-rwxr-xr-xdeps/gyp/test/copies/gyptest-slash.py39
-rwxr-xr-xdeps/gyp/test/copies/gyptest-updir.py30
-rw-r--r--deps/gyp/test/copies/src/copies-attribs.gyp20
-rw-r--r--deps/gyp/test/copies/src/copies-samedir.gyp37
-rw-r--r--deps/gyp/test/copies/src/copies-slash.gyp36
-rw-r--r--deps/gyp/test/copies/src/copies-updir.gyp21
-rw-r--r--deps/gyp/test/copies/src/copies.gyp70
-rw-r--r--deps/gyp/test/copies/src/directory/file31
-rw-r--r--deps/gyp/test/copies/src/directory/file41
-rw-r--r--deps/gyp/test/copies/src/directory/subdir/file51
-rwxr-xr-xdeps/gyp/test/copies/src/executable-file.sh3
-rw-r--r--deps/gyp/test/copies/src/file11
-rw-r--r--deps/gyp/test/copies/src/file21
-rw-r--r--deps/gyp/test/copies/src/parentdir/subdir/file61
18 files changed, 415 insertions, 0 deletions
diff --git a/deps/gyp/test/copies/gyptest-all.py b/deps/gyp/test/copies/gyptest-all.py
new file mode 100755
index 0000000000..aeccf3324c
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-all.py
@@ -0,0 +1,42 @@
+#!/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 file copies using an explicit build target of 'all'.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('copies.gyp',
+ '-G', 'xcode_ninja_target_pattern=^(?!copies_null)',
+ chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+test.build('copies.gyp', test.ALL, chdir='relocate/src')
+
+test.must_match(['relocate', 'src', 'copies-out', 'file1'], 'file1 contents\n')
+
+test.built_file_must_match('copies-out/file2',
+ 'file2 contents\n',
+ chdir='relocate/src')
+
+test.built_file_must_match('copies-out/directory/file3',
+ 'file3 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/directory/file4',
+ 'file4 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/directory/subdir/file5',
+ 'file5 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/subdir/file6',
+ 'file6 contents\n',
+ chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/gyptest-attribs.py b/deps/gyp/test/copies/gyptest-attribs.py
new file mode 100644
index 0000000000..70d717a45e
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-attribs.py
@@ -0,0 +1,41 @@
+#!/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 that copying files preserves file attributes.
+"""
+
+import TestGyp
+
+import os
+import stat
+import sys
+
+
+def check_attribs(path, expected_exec_bit):
+ out_path = test.built_file_path(path, chdir='src')
+
+ in_stat = os.stat(os.path.join('src', path))
+ out_stat = os.stat(out_path)
+ if out_stat.st_mode & stat.S_IXUSR != expected_exec_bit:
+ test.fail_test()
+
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('copies-attribs.gyp', chdir='src')
+
+test.build('copies-attribs.gyp', chdir='src')
+
+if sys.platform != 'win32':
+ out_path = test.built_file_path('executable-file.sh', chdir='src')
+ test.must_contain(out_path,
+ '#!/bin/bash\n'
+ '\n'
+ 'echo echo echo echo cho ho o o\n')
+ check_attribs('executable-file.sh', expected_exec_bit=stat.S_IXUSR)
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/gyptest-default.py b/deps/gyp/test/copies/gyptest-default.py
new file mode 100755
index 0000000000..a916869f0d
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-default.py
@@ -0,0 +1,42 @@
+#!/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 file copies using the build tool default.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+test.run_gyp('copies.gyp',
+ '-G', 'xcode_ninja_target_pattern=^(?!copies_null)',
+ chdir='src')
+
+test.relocate('src', 'relocate/src')
+
+test.build('copies.gyp', chdir='relocate/src')
+
+test.must_match(['relocate', 'src', 'copies-out', 'file1'], 'file1 contents\n')
+
+test.built_file_must_match('copies-out/file2',
+ 'file2 contents\n',
+ chdir='relocate/src')
+
+test.built_file_must_match('copies-out/directory/file3',
+ 'file3 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/directory/file4',
+ 'file4 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/directory/subdir/file5',
+ 'file5 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out/subdir/file6',
+ 'file6 contents\n',
+ chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/gyptest-samedir.py b/deps/gyp/test/copies/gyptest-samedir.py
new file mode 100755
index 0000000000..923ca61557
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-samedir.py
@@ -0,0 +1,28 @@
+#!/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 file copies where two copies sections in the same target have the
+same destination directory.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+test.run_gyp('copies-samedir.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+test.build('copies-samedir.gyp', 'copies_samedir', chdir='relocate/src')
+
+test.built_file_must_match('copies-out-samedir/file1',
+ 'file1 contents\n',
+ chdir='relocate/src')
+
+test.built_file_must_match('copies-out-samedir/file2',
+ 'file2 contents\n',
+ chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/gyptest-slash.py b/deps/gyp/test/copies/gyptest-slash.py
new file mode 100755
index 0000000000..f7a2e549eb
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-slash.py
@@ -0,0 +1,39 @@
+#!/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 file copies with a trailing slash in the destination directory.
+"""
+
+import TestGyp
+
+test = TestGyp.TestGyp()
+test.run_gyp('copies-slash.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+test.build('copies-slash.gyp', chdir='relocate/src')
+
+test.built_file_must_match('copies-out-slash/directory/file3',
+ 'file3 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out-slash/directory/file4',
+ 'file4 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out-slash/directory/subdir/file5',
+ 'file5 contents\n',
+ chdir='relocate/src')
+
+test.built_file_must_match('copies-out-slash-2/directory/file3',
+ 'file3 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out-slash-2/directory/file4',
+ 'file4 contents\n',
+ chdir='relocate/src')
+test.built_file_must_match('copies-out-slash-2/directory/subdir/file5',
+ 'file5 contents\n',
+ chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/gyptest-updir.py b/deps/gyp/test/copies/gyptest-updir.py
new file mode 100755
index 0000000000..a34ae70723
--- /dev/null
+++ b/deps/gyp/test/copies/gyptest-updir.py
@@ -0,0 +1,30 @@
+#!/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 file copies where the destination is one level above an expansion that
+yields a make variable.
+"""
+
+import sys
+
+import TestGyp
+
+if sys.platform == 'darwin':
+ print "This test is currently disabled: https://crbug.com/483696."
+ sys.exit(0)
+
+test = TestGyp.TestGyp()
+test.run_gyp('copies-updir.gyp', chdir='src')
+
+test.relocate('src', 'relocate/src')
+test.build('copies-updir.gyp', 'copies_up', chdir='relocate/src')
+
+test.built_file_must_match('../copies-out-updir/file1',
+ 'file1 contents\n',
+ chdir='relocate/src')
+
+test.pass_test()
diff --git a/deps/gyp/test/copies/src/copies-attribs.gyp b/deps/gyp/test/copies/src/copies-attribs.gyp
new file mode 100644
index 0000000000..073e0d0cf6
--- /dev/null
+++ b/deps/gyp/test/copies/src/copies-attribs.gyp
@@ -0,0 +1,20 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'copies1',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)',
+ 'files': [
+ 'executable-file.sh',
+ ],
+ },
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/copies/src/copies-samedir.gyp b/deps/gyp/test/copies/src/copies-samedir.gyp
new file mode 100644
index 0000000000..2919ce503e
--- /dev/null
+++ b/deps/gyp/test/copies/src/copies-samedir.gyp
@@ -0,0 +1,37 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'copies_samedir',
+ 'type': 'none',
+ 'dependencies': [
+ 'copies_samedir_dependency',
+ ],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out-samedir',
+ 'files': [
+ 'file1',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'copies_samedir_dependency',
+ 'type': 'none',
+ 'direct_dependent_settings': {
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out-samedir',
+ 'files': [
+ 'file2',
+ ],
+ },
+ ],
+ },
+ },
+ ],
+}
diff --git a/deps/gyp/test/copies/src/copies-slash.gyp b/deps/gyp/test/copies/src/copies-slash.gyp
new file mode 100644
index 0000000000..9bf54bd181
--- /dev/null
+++ b/deps/gyp/test/copies/src/copies-slash.gyp
@@ -0,0 +1,36 @@
+# 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': [
+ # A trailing slash on the destination directory should be ignored.
+ {
+ 'target_name': 'copies_recursive_trailing_slash',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out-slash/',
+ 'files': [
+ 'directory/',
+ ],
+ },
+ ],
+ },
+ # Even if the source directory is below <(PRODUCT_DIR).
+ {
+ 'target_name': 'copies_recursive_trailing_slash_in_product_dir',
+ 'type': 'none',
+ 'dependencies': [ ':copies_recursive_trailing_slash' ],
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out-slash-2/',
+ 'files': [
+ '<(PRODUCT_DIR)/copies-out-slash/directory/',
+ ],
+ },
+ ],
+ },
+ ],
+}
+
diff --git a/deps/gyp/test/copies/src/copies-updir.gyp b/deps/gyp/test/copies/src/copies-updir.gyp
new file mode 100644
index 0000000000..bd3bfdd1d2
--- /dev/null
+++ b/deps/gyp/test/copies/src/copies-updir.gyp
@@ -0,0 +1,21 @@
+# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'copies_up',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/../copies-out-updir',
+ 'files': [
+ 'file1',
+ ],
+ },
+ ],
+ },
+ ],
+}
+
diff --git a/deps/gyp/test/copies/src/copies.gyp b/deps/gyp/test/copies/src/copies.gyp
new file mode 100644
index 0000000000..ce2e0cabca
--- /dev/null
+++ b/deps/gyp/test/copies/src/copies.gyp
@@ -0,0 +1,70 @@
+# 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': 'copies1',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': 'copies-out',
+ 'files': [
+ 'file1',
+ ],
+ },
+ ],
+ },
+ {
+ 'target_name': 'copies2',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out',
+ 'files': [
+ 'file2',
+ ],
+ },
+ ],
+ },
+ # Copy a directory tree.
+ {
+ 'target_name': 'copies_recursive',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out',
+ 'files': [
+ 'directory/',
+ ],
+ },
+ ],
+ },
+ # Copy a directory from deeper in the tree (this should not reproduce the
+ # entire directory path in the destination, only the final directory).
+ {
+ 'target_name': 'copies_recursive_depth',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-out',
+ 'files': [
+ 'parentdir/subdir/',
+ ],
+ },
+ ],
+ },
+ # Verify that a null 'files' list doesn't gag the generators.
+ {
+ 'target_name': 'copies_null',
+ 'type': 'none',
+ 'copies': [
+ {
+ 'destination': '<(PRODUCT_DIR)/copies-null',
+ 'files': [],
+ },
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/copies/src/directory/file3 b/deps/gyp/test/copies/src/directory/file3
new file mode 100644
index 0000000000..43f16f3522
--- /dev/null
+++ b/deps/gyp/test/copies/src/directory/file3
@@ -0,0 +1 @@
+file3 contents
diff --git a/deps/gyp/test/copies/src/directory/file4 b/deps/gyp/test/copies/src/directory/file4
new file mode 100644
index 0000000000..5f7270a084
--- /dev/null
+++ b/deps/gyp/test/copies/src/directory/file4
@@ -0,0 +1 @@
+file4 contents
diff --git a/deps/gyp/test/copies/src/directory/subdir/file5 b/deps/gyp/test/copies/src/directory/subdir/file5
new file mode 100644
index 0000000000..41f47186bd
--- /dev/null
+++ b/deps/gyp/test/copies/src/directory/subdir/file5
@@ -0,0 +1 @@
+file5 contents
diff --git a/deps/gyp/test/copies/src/executable-file.sh b/deps/gyp/test/copies/src/executable-file.sh
new file mode 100755
index 0000000000..796953a1a2
--- /dev/null
+++ b/deps/gyp/test/copies/src/executable-file.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo echo echo echo cho ho o o
diff --git a/deps/gyp/test/copies/src/file1 b/deps/gyp/test/copies/src/file1
new file mode 100644
index 0000000000..84d55c5759
--- /dev/null
+++ b/deps/gyp/test/copies/src/file1
@@ -0,0 +1 @@
+file1 contents
diff --git a/deps/gyp/test/copies/src/file2 b/deps/gyp/test/copies/src/file2
new file mode 100644
index 0000000000..af1b8ae35d
--- /dev/null
+++ b/deps/gyp/test/copies/src/file2
@@ -0,0 +1 @@
+file2 contents
diff --git a/deps/gyp/test/copies/src/parentdir/subdir/file6 b/deps/gyp/test/copies/src/parentdir/subdir/file6
new file mode 100644
index 0000000000..f5d5757348
--- /dev/null
+++ b/deps/gyp/test/copies/src/parentdir/subdir/file6
@@ -0,0 +1 @@
+file6 contents