193942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org#!/usr/bin/env python
293942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
393942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org# Copyright (c) 2012 Google Inc. All rights reserved.
493942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org# Use of this source code is governed by a BSD-style license that can be
593942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org# found in the LICENSE file.
693942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
793942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org"""
893942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.orgMake sure that when ULDI is on, we link .objs that make up .libs rather than
993942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.orgthe .libs themselves.
1093942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org"""
1193942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
1293942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.orgimport TestGyp
1393942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
1493942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.orgimport sys
1593942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
1693942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.orgif sys.platform == 'win32':
1793942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
1893942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
1993942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  CHDIR = 'uldi'
2093942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  test.run_gyp('uldi.gyp', chdir=CHDIR)
2193942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  # When linking with ULDI, the duplicated function from the lib will be an
2293942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  # error.
2393942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  test.build('uldi.gyp', 'final_uldi', chdir=CHDIR, status=1)
2493942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  # And when in libs, the duplicated function will be silently dropped, so the
2593942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  # build succeeds.
2693942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  test.build('uldi.gyp', 'final_no_uldi', chdir=CHDIR)
2793942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org
2893942ea156ab1994076967a8a69bffbfb81f8383scottmg@chromium.org  test.pass_test()
29