From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../gyptest-all.py | 41 ++++++++++++++ .../src/subdir1/subdir1.gyp | 66 ++++++++++++++++++++++ .../src/subdir2/subdir2.gyp | 66 ++++++++++++++++++++++ .../src/subdirs.gyp | 16 ++++++ .../src/touch.py | 11 ++++ 5 files changed, 200 insertions(+) create mode 100644 third_party/python/gyp/test/same-target-name-different-directory/gyptest-all.py create mode 100644 third_party/python/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp create mode 100644 third_party/python/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp create mode 100644 third_party/python/gyp/test/same-target-name-different-directory/src/subdirs.gyp create mode 100644 third_party/python/gyp/test/same-target-name-different-directory/src/touch.py (limited to 'third_party/python/gyp/test/same-target-name-different-directory') diff --git a/third_party/python/gyp/test/same-target-name-different-directory/gyptest-all.py b/third_party/python/gyp/test/same-target-name-different-directory/gyptest-all.py new file mode 100644 index 0000000000..755691b576 --- /dev/null +++ b/third_party/python/gyp/test/same-target-name-different-directory/gyptest-all.py @@ -0,0 +1,41 @@ +#!/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. + +""" +Test cases when multiple targets in different directories have the same name. +""" + +import TestGyp + +test = TestGyp.TestGyp(formats=['ninja', 'make']) + +# xcode-ninja fails to generate a project due to id collisions +# cf. https://code.google.com/p/gyp/issues/detail?id=461 +if test.format == 'xcode-ninja': + test.skip_test() + +test.run_gyp('subdirs.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +# Test that we build all targets. +test.build('subdirs.gyp', 'target', chdir='relocate/src') +test.must_exist('relocate/src/subdir1/action1.txt') +test.must_exist('relocate/src/subdir2/action2.txt') + +# Test that we build all targets using the correct actions, even if they have +# the same names. +test.build('subdirs.gyp', 'target_same_action_name', chdir='relocate/src') +test.must_exist('relocate/src/subdir1/action.txt') +test.must_exist('relocate/src/subdir2/action.txt') + +# Test that we build all targets using the correct rules, even if they have +# the same names. +test.build('subdirs.gyp', 'target_same_rule_name', chdir='relocate/src') +test.must_exist('relocate/src/subdir1/rule.txt') +test.must_exist('relocate/src/subdir2/rule.txt') + +test.pass_test() diff --git a/third_party/python/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp b/third_party/python/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp new file mode 100644 index 0000000000..d4ec2e679a --- /dev/null +++ b/third_party/python/gyp/test/same-target-name-different-directory/src/subdir1/subdir1.gyp @@ -0,0 +1,66 @@ +# 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': 'target', + 'type': 'none', + 'actions': [ + { + 'action_name': 'action1', + 'inputs': [], + 'outputs': [ + 'action1.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + { + 'target_name': 'target_same_action_name', + 'type': 'none', + 'actions': [ + { + 'action_name': 'action', + 'inputs': [], + 'outputs': [ + 'action.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + { + 'target_name': 'target_same_rule_name', + 'type': 'none', + 'sources': [ + '../touch.py' + ], + 'rules': [ + { + 'rule_name': 'rule', + 'extension': 'py', + 'inputs': [], + 'outputs': [ + 'rule.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp b/third_party/python/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp new file mode 100644 index 0000000000..9006d450b2 --- /dev/null +++ b/third_party/python/gyp/test/same-target-name-different-directory/src/subdir2/subdir2.gyp @@ -0,0 +1,66 @@ +# 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': 'target', + 'type': 'none', + 'actions': [ + { + 'action_name': 'action2', + 'inputs': [], + 'outputs': [ + 'action2.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + { + 'target_name': 'target_same_action_name', + 'type': 'none', + 'actions': [ + { + 'action_name': 'action', + 'inputs': [], + 'outputs': [ + 'action.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + { + 'target_name': 'target_same_rule_name', + 'type': 'none', + 'sources': [ + '../touch.py' + ], + 'rules': [ + { + 'rule_name': 'rule', + 'extension': 'py', + 'inputs': [], + 'outputs': [ + 'rule.txt', + ], + 'action': [ + 'python', '../touch.py', '<(_outputs)', + ], + # Allows the test to run without hermetic cygwin on windows. + 'msvs_cygwin_shell': 0, + }, + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-target-name-different-directory/src/subdirs.gyp b/third_party/python/gyp/test/same-target-name-different-directory/src/subdirs.gyp new file mode 100644 index 0000000000..65413e73b2 --- /dev/null +++ b/third_party/python/gyp/test/same-target-name-different-directory/src/subdirs.gyp @@ -0,0 +1,16 @@ +# Copyright (c) 2010 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': 'subdirs', + 'type': 'none', + 'dependencies': [ + 'subdir1/subdir1.gyp:*', + 'subdir2/subdir2.gyp:*', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-target-name-different-directory/src/touch.py b/third_party/python/gyp/test/same-target-name-different-directory/src/touch.py new file mode 100644 index 0000000000..2291e9cc56 --- /dev/null +++ b/third_party/python/gyp/test/same-target-name-different-directory/src/touch.py @@ -0,0 +1,11 @@ +#!/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. + +import sys + +f = open(sys.argv[1], 'w+') +f.write('Hello from touch.py\n') +f.close() -- cgit v1.2.3