summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/msvs/buildevents
diff options
context:
space:
mode:
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() {}