summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/msvs/buildevents
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/gyp/test/msvs/buildevents
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/msvs/buildevents')
-rw-r--r--third_party/python/gyp/test/msvs/buildevents/buildevents.gyp14
-rwxr-xr-xthird_party/python/gyp/test/msvs/buildevents/gyptest-msbuild-supports-prepostbuild.py24
-rwxr-xr-xthird_party/python/gyp/test/msvs/buildevents/gyptest-ninja-warnings.py29
-rw-r--r--third_party/python/gyp/test/msvs/buildevents/main.cc5
4 files changed, 72 insertions, 0 deletions
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', '<PreBuildEvent>')
+test.must_contain('main.vcxproj', '<PostBuildEvent>')
+
+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() {}