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 --- .../gyp/test/msvs/buildevents/buildevents.gyp | 14 +++++++++++ .../gyptest-msbuild-supports-prepostbuild.py | 24 ++++++++++++++++++ .../msvs/buildevents/gyptest-ninja-warnings.py | 29 ++++++++++++++++++++++ .../python/gyp/test/msvs/buildevents/main.cc | 5 ++++ 4 files changed, 72 insertions(+) create mode 100644 third_party/python/gyp/test/msvs/buildevents/buildevents.gyp create mode 100755 third_party/python/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py create mode 100755 third_party/python/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py create mode 100644 third_party/python/gyp/test/msvs/buildevents/main.cc (limited to 'third_party/python/gyp/test/msvs/buildevents') diff --git a/third_party/python/gyp/test/msvs/buildevents/buildevents.gyp b/third_party/python/gyp/test/msvs/buildevents/buildevents.gyp new file mode 100644 index 0000000000..e0304dd5c6 --- /dev/null +++ b/third_party/python/gyp/test/msvs/buildevents/buildevents.gyp @@ -0,0 +1,14 @@ +# 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': [ + { + 'target_name': 'main', + 'type': 'executable', + 'sources': [ 'main.cc', ], + 'msvs_prebuild': r'echo starting', + 'msvs_postbuild': r'echo finished', + }, + ], +} diff --git a/third_party/python/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py b/third_party/python/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py new file mode 100755 index 0000000000..208f434560 --- /dev/null +++ b/third_party/python/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py @@ -0,0 +1,24 @@ +#!/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 that msvs_prebuild and msvs_postbuild can be specified in both +VS 2008 and 2010. +""" + +import TestGyp + +test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all') + +test.run_gyp('buildevents.gyp', '-G', 'msvs_version=2008') +test.must_contain('main.vcproj', 'Name="VCPreBuildEventTool"') +test.must_contain('main.vcproj', 'Name="VCPostBuildEventTool"') + +test.run_gyp('buildevents.gyp', '-G', 'msvs_version=2010') +test.must_contain('main.vcxproj', '') +test.must_contain('main.vcxproj', '') + +test.pass_test() diff --git a/third_party/python/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py b/third_party/python/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py new file mode 100755 index 0000000000..be4ec9921a --- /dev/null +++ b/third_party/python/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py @@ -0,0 +1,29 @@ +#!/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 that ninja errors out when encountering msvs_prebuild/msvs_postbuild. +""" + +import sys +import TestCmd +import TestGyp + + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + test.run_gyp('buildevents.gyp', + status=1, + stderr=r'.*msvs_prebuild not supported \(target main\).*', + match=TestCmd.match_re_dotall) + + test.run_gyp('buildevents.gyp', + status=1, + stderr=r'.*msvs_postbuild not supported \(target main\).*', + match=TestCmd.match_re_dotall) + + test.pass_test() diff --git a/third_party/python/gyp/test/msvs/buildevents/main.cc b/third_party/python/gyp/test/msvs/buildevents/main.cc new file mode 100644 index 0000000000..03c0285a6c --- /dev/null +++ b/third_party/python/gyp/test/msvs/buildevents/main.cc @@ -0,0 +1,5 @@ +// 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. + +int main() {} -- cgit v1.2.3