13102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org#!/usr/bin/env python
23102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
33102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org# Copyright (c) 2013 Google Inc. All rights reserved.
43102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org# Use of this source code is governed by a BSD-style license that can be
53102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org# found in the LICENSE file.
63102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
73102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org"""
83102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.orgMake sure msvs_shard works correctly.
93102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org"""
103102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
113102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.orgimport TestGyp
123102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
133102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.orgimport sys
143102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
153102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.orgif sys.platform == 'win32':
163102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
173102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
183102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  CHDIR = 'shard'
193102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.run_gyp('shard.gyp', chdir=CHDIR)
203102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.build('shard.gyp', test.ALL, chdir=CHDIR)
213102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
223102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.built_file_must_exist('shard_0.lib', chdir=CHDIR)
233102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.built_file_must_exist('shard_1.lib', chdir=CHDIR)
243102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.built_file_must_exist('shard_2.lib', chdir=CHDIR)
253102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.built_file_must_exist('shard_3.lib', chdir=CHDIR)
263102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org
2700f5497928048abdf753ad602292340aa962cbf8scottmg@chromium.org  test.run_gyp('shard_ref.gyp', chdir=CHDIR)
2800f5497928048abdf753ad602292340aa962cbf8scottmg@chromium.org  test.build('shard_ref.gyp', test.ALL, chdir=CHDIR)
2900f5497928048abdf753ad602292340aa962cbf8scottmg@chromium.org
303102ef6988023572afa56b6f0db321cd81790b63scottmg@chromium.org  test.pass_test()
31