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 --- .../test/variables/commands/commands-repeated.gyp | 128 +++++++++++++++++++ .../commands/commands-repeated.gyp.stdout | 136 +++++++++++++++++++++ .../commands/commands-repeated.gypd.golden | 77 ++++++++++++ .../gyp/test/variables/commands/commands.gyp | 91 ++++++++++++++ .../commands/commands.gyp.ignore-env.stdout | 96 +++++++++++++++ .../test/variables/commands/commands.gyp.stdout | 96 +++++++++++++++ .../test/variables/commands/commands.gypd.golden | 66 ++++++++++ .../gyp/test/variables/commands/commands.gypi | 23 ++++ .../commands/gyptest-commands-ignore-env.py | 47 +++++++ .../commands/gyptest-commands-repeated-multidir.py | 23 ++++ .../commands/gyptest-commands-repeated.py | 40 ++++++ .../test/variables/commands/gyptest-commands.py | 40 ++++++ .../commands/repeated_multidir/dir_1/test_1.gyp | 13 ++ .../commands/repeated_multidir/dir_2/test_2.gyp | 13 ++ .../variables/commands/repeated_multidir/main.gyp | 16 +++ .../repeated_multidir/print_cwd_basename.py | 11 ++ .../repeated_multidir/repeated_command_common.gypi | 25 ++++ .../python/gyp/test/variables/commands/test.py | 7 ++ .../gyp/test/variables/commands/update_golden | 11 ++ .../python/gyp/test/variables/empty/empty.gyp | 13 ++ .../python/gyp/test/variables/empty/empty.gypi | 9 ++ .../gyp/test/variables/empty/gyptest-empty.py | 19 +++ .../test/variables/filelist/filelist.gyp.stdout | 26 ++++ .../test/variables/filelist/filelist.gypd.golden | 43 +++++++ .../variables/filelist/gyptest-filelist-golden.py | 53 ++++++++ .../test/variables/filelist/gyptest-filelist.py | 29 +++++ .../gyp/test/variables/filelist/src/dummy.py | 5 + .../gyp/test/variables/filelist/src/filelist.gyp | 93 ++++++++++++++ .../gyp/test/variables/filelist/src/filelist2.gyp | 40 ++++++ .../gyp/test/variables/filelist/update_golden | 8 ++ .../test/variables/latelate/gyptest-latelate.py | 25 ++++ .../gyp/test/variables/latelate/src/latelate.gyp | 34 ++++++ .../gyp/test/variables/latelate/src/program.cc | 13 ++ .../test/variables/variable-in-path/C1/hello.cc | 7 ++ .../variable-in-path/gyptest-variable-in-path.py | 23 ++++ .../variable-in-path/variable-in-path.gyp | 31 +++++ 36 files changed, 1430 insertions(+) create mode 100644 third_party/python/gyp/test/variables/commands/commands-repeated.gyp create mode 100644 third_party/python/gyp/test/variables/commands/commands-repeated.gyp.stdout create mode 100644 third_party/python/gyp/test/variables/commands/commands-repeated.gypd.golden create mode 100644 third_party/python/gyp/test/variables/commands/commands.gyp create mode 100644 third_party/python/gyp/test/variables/commands/commands.gyp.ignore-env.stdout create mode 100644 third_party/python/gyp/test/variables/commands/commands.gyp.stdout create mode 100644 third_party/python/gyp/test/variables/commands/commands.gypd.golden create mode 100644 third_party/python/gyp/test/variables/commands/commands.gypi create mode 100755 third_party/python/gyp/test/variables/commands/gyptest-commands-ignore-env.py create mode 100755 third_party/python/gyp/test/variables/commands/gyptest-commands-repeated-multidir.py create mode 100755 third_party/python/gyp/test/variables/commands/gyptest-commands-repeated.py create mode 100755 third_party/python/gyp/test/variables/commands/gyptest-commands.py create mode 100644 third_party/python/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp create mode 100644 third_party/python/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp create mode 100644 third_party/python/gyp/test/variables/commands/repeated_multidir/main.gyp create mode 100755 third_party/python/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py create mode 100644 third_party/python/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi create mode 100644 third_party/python/gyp/test/variables/commands/test.py create mode 100755 third_party/python/gyp/test/variables/commands/update_golden create mode 100644 third_party/python/gyp/test/variables/empty/empty.gyp create mode 100644 third_party/python/gyp/test/variables/empty/empty.gypi create mode 100755 third_party/python/gyp/test/variables/empty/gyptest-empty.py create mode 100644 third_party/python/gyp/test/variables/filelist/filelist.gyp.stdout create mode 100644 third_party/python/gyp/test/variables/filelist/filelist.gypd.golden create mode 100644 third_party/python/gyp/test/variables/filelist/gyptest-filelist-golden.py create mode 100755 third_party/python/gyp/test/variables/filelist/gyptest-filelist.py create mode 100644 third_party/python/gyp/test/variables/filelist/src/dummy.py create mode 100644 third_party/python/gyp/test/variables/filelist/src/filelist.gyp create mode 100644 third_party/python/gyp/test/variables/filelist/src/filelist2.gyp create mode 100755 third_party/python/gyp/test/variables/filelist/update_golden create mode 100755 third_party/python/gyp/test/variables/latelate/gyptest-latelate.py create mode 100644 third_party/python/gyp/test/variables/latelate/src/latelate.gyp create mode 100644 third_party/python/gyp/test/variables/latelate/src/program.cc create mode 100644 third_party/python/gyp/test/variables/variable-in-path/C1/hello.cc create mode 100644 third_party/python/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py create mode 100644 third_party/python/gyp/test/variables/variable-in-path/variable-in-path.gyp (limited to 'third_party/python/gyp/test/variables') diff --git a/third_party/python/gyp/test/variables/commands/commands-repeated.gyp b/third_party/python/gyp/test/variables/commands/commands-repeated.gyp new file mode 100644 index 0000000000..1f52e75936 --- /dev/null +++ b/third_party/python/gyp/test/variables/commands/commands-repeated.gyp @@ -0,0 +1,128 @@ +# 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. + +# This is a simple test file to make sure that variable substitution +# happens correctly. Run "run_tests.py" using python to generate the +# output from this gyp file. + +{ + 'variables': { + 'pi': 'import math; print(math.pi)', + 'third_letters': "<(other_letters)HIJK", + 'letters_list': 'ABCD', + 'other_letters': '<(letters_list)EFG', + 'check_included': '<(included_variable)', + 'check_lists': [ + '<(included_variable)', + '<(third_letters)', + ], + 'check_int': 5, + 'check_str_int': '6', + 'check_list_int': [ + 7, + '8', + 9, + ], + 'not_int_1': ' 10', + 'not_int_2': '11 ', + 'not_int_3': '012', + 'not_int_4': '13.0', + 'not_int_5': '+14', + 'negative_int': '-15', + 'zero_int': '0', + }, + 'includes': [ + 'commands.gypi', + ], + 'targets': [ + { + 'target_name': 'foo', + 'type': 'none', + 'variables': { + 'var1': ' commands.gyp.stdout +python ../../../gyp --ignore-environment --debug variables --format gypd --depth . commands.gyp > commands.gyp.ignore-env.stdout +cp -f commands.gypd commands.gypd.golden +python ../../../gyp --debug variables --format gypd --depth . commands-repeated.gyp > commands-repeated.gyp.stdout +cp -f commands-repeated.gypd commands-repeated.gypd.golden diff --git a/third_party/python/gyp/test/variables/empty/empty.gyp b/third_party/python/gyp/test/variables/empty/empty.gyp new file mode 100644 index 0000000000..207be06fe7 --- /dev/null +++ b/third_party/python/gyp/test/variables/empty/empty.gyp @@ -0,0 +1,13 @@ +# Copyright (c) 2015 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. + +{ + 'includes': ['empty.gypi'], + 'targets': [ + { + 'target_name': 'empty', + 'type': 'none', + }, + ], +} diff --git a/third_party/python/gyp/test/variables/empty/empty.gypi b/third_party/python/gyp/test/variables/empty/empty.gypi new file mode 100644 index 0000000000..e95031fca5 --- /dev/null +++ b/third_party/python/gyp/test/variables/empty/empty.gypi @@ -0,0 +1,9 @@ +# Copyright (c) 2015 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': { + '': '', + }, +} diff --git a/third_party/python/gyp/test/variables/empty/gyptest-empty.py b/third_party/python/gyp/test/variables/empty/gyptest-empty.py new file mode 100755 index 0000000000..4cbe166fdc --- /dev/null +++ b/third_party/python/gyp/test/variables/empty/gyptest-empty.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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 that empty variable names don't cause infinite loops. +""" + +import os + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('empty.gyp') + +test.pass_test() diff --git a/third_party/python/gyp/test/variables/filelist/filelist.gyp.stdout b/third_party/python/gyp/test/variables/filelist/filelist.gyp.stdout new file mode 100644 index 0000000000..595a19c684 --- /dev/null +++ b/third_party/python/gyp/test/variables/filelist/filelist.gyp.stdout @@ -0,0 +1,26 @@ +VARIABLES:input.py:562:ExpandVariables Matches: {'content': 'names.txt <@(names', 'is_array': '', 'replace': '<|(names.txt <@(names)', 'type': '<|', 'command_string': None} +VARIABLES:input.py:562:ExpandVariables Matches: {'content': 'names', 'is_array': '', 'replace': '<@(names)', 'type': '<@', 'command_string': None} +VARIABLES:input.py:797:ExpandVariables Found output 'names.txt John Jacob Jingleheimer Schmidt', recursing. +VARIABLES:input.py:797:ExpandVariables Found output 'names.txt', recursing. +VARIABLES:input.py:562:ExpandVariables Matches: {'content': 'names_listfile', 'is_array': '', 'replace': '<(names_listfile)', 'type': '<', 'command_string': None} +VARIABLES:input.py:797:ExpandVariables Found output 'names.txt', recursing. +VARIABLES:input.py:562:ExpandVariables Matches: {'content': 'names_listfile', 'is_array': '', 'replace': '<(names_listfile)', 'type': '<', 'command_string': None} +VARIABLES:input.py:797:ExpandVariables Found output 'names.txt', recursing. +VARIABLES:input.py:562:ExpandVariables Matches: {'content': 'cat <(names_listfile', 'is_array': '', 'replace': ' filelist.gyp.stdout +cp -f src/filelist.gypd filelist.gypd.golden diff --git a/third_party/python/gyp/test/variables/latelate/gyptest-latelate.py b/third_party/python/gyp/test/variables/latelate/gyptest-latelate.py new file mode 100755 index 0000000000..2d77dfec5e --- /dev/null +++ b/third_party/python/gyp/test/variables/latelate/gyptest-latelate.py @@ -0,0 +1,25 @@ +#!/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 ^(latelate) style variables work. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('latelate.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +test.build('latelate.gyp', test.ALL, chdir='relocate/src') + +test.run_built_executable( + 'program', chdir='relocate/src', stdout='program.cc\n') + + +test.pass_test() diff --git a/third_party/python/gyp/test/variables/latelate/src/latelate.gyp b/third_party/python/gyp/test/variables/latelate/src/latelate.gyp new file mode 100644 index 0000000000..312f3765b6 --- /dev/null +++ b/third_party/python/gyp/test/variables/latelate/src/latelate.gyp @@ -0,0 +1,34 @@ +# 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. + +{ + 'target_defaults': { + 'target_conditions': [ + ['has_lame==1', { + 'sources/': [ + ['exclude', 'lame'], + ], + }], + ], + }, + 'targets': [ + { + 'target_name': 'program', + 'type': 'executable', + 'variables': { + 'has_lame': 1, + }, + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)', + ], + 'defines': [ + 'FOO="^(_sources)"', + ], + 'sources': [ + 'program.cc', + 'this_is_lame.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/variables/latelate/src/program.cc b/third_party/python/gyp/test/variables/latelate/src/program.cc new file mode 100644 index 0000000000..97c98ae5b9 --- /dev/null +++ b/third_party/python/gyp/test/variables/latelate/src/program.cc @@ -0,0 +1,13 @@ +/* + * 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. + */ + +#include + + +int main(void) { + printf(FOO "\n"); + return 0; +} diff --git a/third_party/python/gyp/test/variables/variable-in-path/C1/hello.cc b/third_party/python/gyp/test/variables/variable-in-path/C1/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/variables/variable-in-path/C1/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py b/third_party/python/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py new file mode 100644 index 0000000000..b73a279da7 --- /dev/null +++ b/third_party/python/gyp/test/variables/variable-in-path/gyptest-variable-in-path.py @@ -0,0 +1,23 @@ +#!/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. + +""" +Make sure <(CONFIGURATION_NAME) variable is correctly expanded. +""" + +import TestGyp + +import sys + +test = TestGyp.TestGyp() +test.set_configuration('C1') + +test.run_gyp('variable-in-path.gyp') +test.build('variable-in-path.gyp', 'hello1') +test.build('variable-in-path.gyp', 'hello2') + + +test.pass_test() diff --git a/third_party/python/gyp/test/variables/variable-in-path/variable-in-path.gyp b/third_party/python/gyp/test/variables/variable-in-path/variable-in-path.gyp new file mode 100644 index 0000000000..908d21eb66 --- /dev/null +++ b/third_party/python/gyp/test/variables/variable-in-path/variable-in-path.gyp @@ -0,0 +1,31 @@ +# 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': 'hello1', + 'type': 'executable', + 'sources': [ + '<(CONFIGURATION_NAME)/hello.cc', + ], + }, + { + 'target_name': 'hello2', + 'type': 'executable', + 'sources': [ + './<(CONFIGURATION_NAME)/hello.cc', + ], + }, + ], + 'target_defaults': { + 'default_configuration': 'C1', + 'configurations': { + 'C1': { + }, + 'C2': { + }, + }, + }, +} -- cgit v1.2.3