14fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org#!/usr/bin/env python
24fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
396a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org# Copyright (c) 2014 Google Inc. All rights reserved.
44fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org# Use of this source code is governed by a BSD-style license that can be
54fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org# found in the LICENSE file.
64fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
74fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org"""
896a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.orgVerifies that ninja errors out when encountering msvs_prebuild/msvs_postbuild.
94fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org"""
104fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
114fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.orgimport sys
1296a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.orgimport TestCmd
134fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.orgimport TestGyp
144fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
154fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
164fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.orgif sys.platform == 'win32':
174fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org  test = TestGyp.TestGyp(formats=['ninja'])
184fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
1996a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org  test.run_gyp('buildevents.gyp',
2096a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      status=1,
2196a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      stderr='.*msvs_prebuild not supported \(target main\).*',
2296a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      match=TestCmd.match_re_dotall)
234fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
2496a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org  test.run_gyp('buildevents.gyp',
2596a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      status=1,
2696a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      stderr='.*msvs_postbuild not supported \(target main\).*',
2796a0c8a9e08e30e895168fa6e0cad24ae4321684scottmg@chromium.org      match=TestCmd.match_re_dotall)
284fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org
294fd9364155f32bc5161b88429458c6d3a7f8430fscottmg@chromium.org  test.pass_test()
30