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 --- .../python/gyp/test/same-gyp-name/gyptest-all.py | 38 ++++++++++++++++++++++ .../gyp/test/same-gyp-name/gyptest-default.py | 38 ++++++++++++++++++++++ .../gyp/test/same-gyp-name/gyptest-library.py | 20 ++++++++++++ .../gyp/test/same-gyp-name/library/one/sub.gyp | 11 +++++++ .../python/gyp/test/same-gyp-name/library/test.gyp | 15 +++++++++ .../gyp/test/same-gyp-name/library/two/sub.gyp | 11 +++++++ .../python/gyp/test/same-gyp-name/src/all.gyp | 16 +++++++++ .../test/same-gyp-name/src/subdir1/executable.gyp | 15 +++++++++ .../gyp/test/same-gyp-name/src/subdir1/main1.cc | 6 ++++ .../test/same-gyp-name/src/subdir2/executable.gyp | 15 +++++++++ .../gyp/test/same-gyp-name/src/subdir2/main2.cc | 6 ++++ 11 files changed, 191 insertions(+) create mode 100755 third_party/python/gyp/test/same-gyp-name/gyptest-all.py create mode 100755 third_party/python/gyp/test/same-gyp-name/gyptest-default.py create mode 100644 third_party/python/gyp/test/same-gyp-name/gyptest-library.py create mode 100644 third_party/python/gyp/test/same-gyp-name/library/one/sub.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/library/test.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/library/two/sub.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/src/all.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/src/subdir1/executable.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/src/subdir1/main1.cc create mode 100644 third_party/python/gyp/test/same-gyp-name/src/subdir2/executable.gyp create mode 100644 third_party/python/gyp/test/same-gyp-name/src/subdir2/main2.cc (limited to 'third_party/python/gyp/test/same-gyp-name') diff --git a/third_party/python/gyp/test/same-gyp-name/gyptest-all.py b/third_party/python/gyp/test/same-gyp-name/gyptest-all.py new file mode 100755 index 0000000000..cda1a72d4d --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/gyptest-all.py @@ -0,0 +1,38 @@ +#!/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. + +""" +Build a .gyp that depends on 2 gyp files with the same name. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('all.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +test.build('all.gyp', test.ALL, chdir='relocate/src') + +expect1 = """\ +Hello from main1.cc +""" + +expect2 = """\ +Hello from main2.cc +""" + +if test.format == 'xcode': + chdir1 = 'relocate/src/subdir1' + chdir2 = 'relocate/src/subdir2' +else: + chdir1 = chdir2 = 'relocate/src' + +test.run_built_executable('program1', chdir=chdir1, stdout=expect1) +test.run_built_executable('program2', chdir=chdir2, stdout=expect2) + +test.pass_test() diff --git a/third_party/python/gyp/test/same-gyp-name/gyptest-default.py b/third_party/python/gyp/test/same-gyp-name/gyptest-default.py new file mode 100755 index 0000000000..5e4bba0012 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/gyptest-default.py @@ -0,0 +1,38 @@ +#!/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. + +""" +Build a .gyp that depends on 2 gyp files with the same name. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('all.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +test.build('all.gyp', chdir='relocate/src') + +expect1 = """\ +Hello from main1.cc +""" + +expect2 = """\ +Hello from main2.cc +""" + +if test.format == 'xcode': + chdir1 = 'relocate/src/subdir1' + chdir2 = 'relocate/src/subdir2' +else: + chdir1 = chdir2 = 'relocate/src' + +test.run_built_executable('program1', chdir=chdir1, stdout=expect1) +test.run_built_executable('program2', chdir=chdir2, stdout=expect2) + +test.pass_test() diff --git a/third_party/python/gyp/test/same-gyp-name/gyptest-library.py b/third_party/python/gyp/test/same-gyp-name/gyptest-library.py new file mode 100644 index 0000000000..957a4a52d6 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/gyptest-library.py @@ -0,0 +1,20 @@ +#!/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 that a dependency on two gyp files with the same name do not create a +uid collision in the resulting generated xcode file. +""" + +import TestGyp + +import sys + +test = TestGyp.TestGyp() + +test.run_gyp('test.gyp', chdir='library') + +test.pass_test() diff --git a/third_party/python/gyp/test/same-gyp-name/library/one/sub.gyp b/third_party/python/gyp/test/same-gyp-name/library/one/sub.gyp new file mode 100644 index 0000000000..1bed941e54 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/library/one/sub.gyp @@ -0,0 +1,11 @@ +# 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': 'one', + 'type': 'static_library', + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/library/test.gyp b/third_party/python/gyp/test/same-gyp-name/library/test.gyp new file mode 100644 index 0000000000..552a77ed7e --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/library/test.gyp @@ -0,0 +1,15 @@ +# 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': 'duplicate_names', + 'type': 'shared_library', + 'dependencies': [ + 'one/sub.gyp:one', + 'two/sub.gyp:two', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/library/two/sub.gyp b/third_party/python/gyp/test/same-gyp-name/library/two/sub.gyp new file mode 100644 index 0000000000..934c98a496 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/library/two/sub.gyp @@ -0,0 +1,11 @@ +# 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': 'two', + 'type': 'static_library', + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/src/all.gyp b/third_party/python/gyp/test/same-gyp-name/src/all.gyp new file mode 100644 index 0000000000..229f02ea84 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/src/all.gyp @@ -0,0 +1,16 @@ +# 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': 'all_exes', + 'type': 'none', + 'dependencies': [ + 'subdir1/executable.gyp:*', + 'subdir2/executable.gyp:*', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/src/subdir1/executable.gyp b/third_party/python/gyp/test/same-gyp-name/src/subdir1/executable.gyp new file mode 100644 index 0000000000..82483b4c69 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/src/subdir1/executable.gyp @@ -0,0 +1,15 @@ +# 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': 'program1', + 'type': 'executable', + 'sources': [ + 'main1.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/src/subdir1/main1.cc b/third_party/python/gyp/test/same-gyp-name/src/subdir1/main1.cc new file mode 100644 index 0000000000..3645558324 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/src/subdir1/main1.cc @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello from main1.cc\n"); + return 0; +} diff --git a/third_party/python/gyp/test/same-gyp-name/src/subdir2/executable.gyp b/third_party/python/gyp/test/same-gyp-name/src/subdir2/executable.gyp new file mode 100644 index 0000000000..e3537013eb --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/src/subdir2/executable.gyp @@ -0,0 +1,15 @@ +# 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': 'program2', + 'type': 'executable', + 'sources': [ + 'main2.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/same-gyp-name/src/subdir2/main2.cc b/third_party/python/gyp/test/same-gyp-name/src/subdir2/main2.cc new file mode 100644 index 0000000000..0c724dee35 --- /dev/null +++ b/third_party/python/gyp/test/same-gyp-name/src/subdir2/main2.cc @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello from main2.cc\n"); + return 0; +} -- cgit v1.2.3