Skip to content
Browse files

win ninja: build fix for msvs_pre/postbuild error test

Follow up to r1837. The previous test used print, which can get lost
when running in parallel. Instead, just error out with an exception
and update the test to expect that.

TBR=bradn@chromium.org

Review URL: https://codereview.chromium.org/139803002

git-svn-id: http://gyp.googlecode.com/svn/trunk@1838 78cadc50-ecff-11dd-a971-7dbc132099af
  • Loading branch information...
1 parent 4fd9364 commit 96a0c8a9e08e30e895168fa6e0cad24ae4321684 scottmg@chromium.org committed Jan 15, 2014
Showing with 16 additions and 9 deletions.
  1. +5 −3 pylib/gyp/msvs_emulation.py
  2. +11 −6 test/msvs/buildevents/gyptest-ninja-warnings.py
View
8 pylib/gyp/msvs_emulation.py
@@ -167,12 +167,14 @@ def __init__(self, spec, generator_flags):
'msvs_prebuild',
'msvs_postbuild',
]
+ unsupported = []
for field in unsupported_fields:
for config in configs.values():
if field in config:
- print "Warning: %s not supported, dropping. (target %s)" \
- % (field, spec['target_name'])
- break
+ unsupported += ["%s not supported (target %s)." %
+ (field, spec['target_name'])]
+ if unsupported:
+ raise Exception('\n'.join(unsupported))
def GetVSMacroEnv(self, base_to_build=None, config=None):
"""Get a dict of variables mapping internal VS macro names to their gyp
View
17 test/msvs/buildevents/gyptest-ninja-warnings.py
@@ -1,24 +1,29 @@
#!/usr/bin/env python
-# Copyright (c) 2011 Google Inc. All rights reserved.
+# 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 warns about msvs_prebuild/msvs_postbuild.
+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')
+ test.run_gyp('buildevents.gyp',
+ status=1,
+ stderr='.*msvs_prebuild not supported \(target main\).*',
+ match=TestCmd.match_re_dotall)
- test.must_contain_all_lines(test.stdout(),
- ['Warning: msvs_prebuild not supported, dropping. (target main)',
- 'Warning: msvs_postbuild not supported, dropping. (target main)'])
+ test.run_gyp('buildevents.gyp',
+ status=1,
+ stderr='.*msvs_postbuild not supported \(target main\).*',
+ match=TestCmd.match_re_dotall)
test.pass_test()

0 comments on commit 96a0c8a

Please sign in to comment.
Something went wrong with that request. Please try again.