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 --- .../make_global_settings/full-toolchain/bar.cc | 1 + .../test/make_global_settings/full-toolchain/foo.c | 1 + .../full-toolchain/gyptest-make_global_settings.py | 53 ++++++++++++++++++++++ .../full-toolchain/make_global_settings.gyp | 22 +++++++++ .../make_global_settings/full-toolchain/my_nm.py | 9 ++++ .../full-toolchain/my_readelf.py | 9 ++++ 6 files changed, 95 insertions(+) create mode 100644 third_party/python/gyp/test/make_global_settings/full-toolchain/bar.cc create mode 100644 third_party/python/gyp/test/make_global_settings/full-toolchain/foo.c create mode 100644 third_party/python/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py create mode 100644 third_party/python/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp create mode 100755 third_party/python/gyp/test/make_global_settings/full-toolchain/my_nm.py create mode 100755 third_party/python/gyp/test/make_global_settings/full-toolchain/my_readelf.py (limited to 'third_party/python/gyp/test/make_global_settings/full-toolchain') diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/bar.cc b/third_party/python/gyp/test/make_global_settings/full-toolchain/bar.cc new file mode 100644 index 0000000000..afb422ba1a --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/bar.cc @@ -0,0 +1 @@ +#error Not a real source file diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/foo.c b/third_party/python/gyp/test/make_global_settings/full-toolchain/foo.c new file mode 100644 index 0000000000..afb422ba1a --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/foo.c @@ -0,0 +1 @@ +#error Not a real source file diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py b/third_party/python/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py new file mode 100644 index 0000000000..542fd631c2 --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/gyptest-make_global_settings.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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 make_global_settings works with the full toolchain. +""" + +from __future__ import print_function + +import os +import sys +import TestGyp + +if sys.platform == 'win32': + # cross compiling not supported by ninja on windows + # and make not supported on windows at all. + sys.exit(0) + +print("This test is currently disabled: https://crbug.com/483696.") +sys.exit(0) + +test = TestGyp.TestGyp(formats=['ninja']) +# Must set the test format to something with a flavor (the part after the '-') +# in order to test the desired behavior. Since we want to run a non-host +# toolchain, we have to set the flavor to something that the ninja generator +# doesn't know about, so it doesn't default to the host-specific tools (e.g., +# 'otool' on mac to generate the .TOC). +# +# Note that we can't just pass format=['ninja-some_toolchain'] to the +# constructor above, because then this test wouldn't be recognized as a ninja +# format test. +test.formats = ['ninja-my_flavor' if f == 'ninja' else f for f in test.formats] + +gyp_file = 'make_global_settings.gyp' + +test.run_gyp(gyp_file, + # Teach the .gyp file about the location of my_nm.py and + # my_readelf.py, and the python executable. + '-Dworkdir=%s' % test.workdir, + '-Dpython=%s' % sys.executable) +test.build(gyp_file, + arguments=['-v'] if test.format == 'ninja-my_flavor' else []) + +expected = ['MY_CC', 'MY_CXX'] +test.must_contain_all_lines(test.stdout(), expected) + +test.must_contain(test.built_file_path('RAN_MY_NM'), 'RAN_MY_NM') +test.must_contain(test.built_file_path('RAN_MY_READELF'), 'RAN_MY_READELF') + +test.pass_test() diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp b/third_party/python/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp new file mode 100644 index 0000000000..2c3266322d --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/make_global_settings.gyp @@ -0,0 +1,22 @@ +# Copyright (c) 2013 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style licence that can be +# found in the LICENSE file. + +{ + 'make_global_settings': [ + ['CC', '/bin/echo MY_CC'], + ['CXX', '/bin/echo MY_CXX'], + ['NM', '<(python) <(workdir)/my_nm.py'], + ['READELF', '<(python) <(workdir)/my_readelf.py'], + ], + 'targets': [ + { + 'target_name': 'test', + 'type': 'shared_library', + 'sources': [ + 'foo.c', + 'bar.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/my_nm.py b/third_party/python/gyp/test/make_global_settings/full-toolchain/my_nm.py new file mode 100755 index 0000000000..2c4e678110 --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/my_nm.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# Copyright (c) 2014 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. +from __future__ import print_function +import sys +print(sys.argv) +with open('RAN_MY_NM', 'w') as f: + f.write('RAN_MY_NM') diff --git a/third_party/python/gyp/test/make_global_settings/full-toolchain/my_readelf.py b/third_party/python/gyp/test/make_global_settings/full-toolchain/my_readelf.py new file mode 100755 index 0000000000..626665435e --- /dev/null +++ b/third_party/python/gyp/test/make_global_settings/full-toolchain/my_readelf.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +# Copyright (c) 2014 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. +from __future__ import print_function +import sys +print(sys.argv) +with open('RAN_MY_READELF', 'w') as f: + f.write('RAN_MY_READELF') -- cgit v1.2.3