1e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org#!/usr/bin/env python
2e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
3e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org# Copyright (c) 2012 Google Inc. All rights reserved.
4e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org# Use of this source code is governed by a BSD-style license that can be
5e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org# found in the LICENSE file.
6e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
7e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org"""
8e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.orgMake sure subsystem setting is extracted properly.
9e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org"""
10e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
11e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.orgimport TestGyp
12e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
13e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.orgimport sys
14e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
15e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.orgif sys.platform == 'win32':
1689fcd93b01b73e1666ad96aac77e8d04f37d01d9scottmg@chromium.org  test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
17e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
18e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  CHDIR = 'linker-flags'
19e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.run_gyp('subsystem.gyp', chdir=CHDIR)
20e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
21e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.build('subsystem.gyp', 'test_console_ok', chdir=CHDIR)
22e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.build('subsystem.gyp', 'test_console_fail', chdir=CHDIR, status=1)
23e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.build('subsystem.gyp', 'test_windows_ok', chdir=CHDIR)
24e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.build('subsystem.gyp', 'test_windows_fail', chdir=CHDIR, status=1)
25e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
26e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  # TODO(scottmg): There are other subsystems (WinCE, etc.) that we don't use.
27e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org
28e3f4a73ddb8139e45e6539a74b16eeb5f7abc7e5scottmg@chromium.org  test.pass_test()
29