Sha256: 8a18901058c6d8282ae2da5cfa7385cfbb39dc4864aae7887744fe00add84a00

Contents?: true

Size: 1.81 KB

Versions: 40

Compression:

Stored size: 1.81 KB

Contents

#!/usr/bin/env python

# Copyright (c) 2012 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.

"""
Verify that building an object file correctly depends on running actions in
dependent targets, but not the targets themselves.
"""

import os
import sys
import TestGyp

# NOTE(piman): This test will not work with other generators because:
# - it explicitly tests the optimization, which is not implemented (yet?) on
# other generators
# - it relies on the exact path to output object files, which is generator
# dependent, and actually, relies on the ability to build only that object file,
# which I don't think is available on all generators.
# TODO(piman): Extend to other generators when possible.
test = TestGyp.TestGyp(formats=['ninja'])

test.run_gyp('action_dependencies.gyp', chdir='src')

chdir = 'relocate/src'
test.relocate('src', chdir)

objext = '.obj' if sys.platform == 'win32' else '.o'

test.build('action_dependencies.gyp',
           os.path.join('obj', 'b.b' + objext),
           chdir=chdir)

# The 'a' actions should be run (letting b.c compile), but the a static library
# should not be built.
test.built_file_must_not_exist('a', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_not_exist('b', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_exist(os.path.join('obj', 'b.b' + objext), chdir=chdir)

test.build('action_dependencies.gyp',
           os.path.join('obj', 'c.c' + objext),
           chdir=chdir)

# 'a' and 'b' should be built, so that the 'c' action succeeds, letting c.c
# compile
test.built_file_must_exist('a', type=test.STATIC_LIB, chdir=chdir)
test.built_file_must_exist('b', type=test.EXECUTABLE, chdir=chdir)
test.built_file_must_exist(os.path.join('obj', 'c.c' + objext), chdir=chdir)


test.pass_test()

Version data entries

40 entries across 40 versions & 6 rubygems

Version Path
libv8-3.16.14.19.1 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.19 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.18 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
tree-sitter-0.0.1 ext/tree-sitter/tree-sitter/externals/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
arcabouco-0.2.13 vendor/bundle/gems/libv8-3.16.14.17/vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.17 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.16 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.15 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.14 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-tmpfork-3.16.14.13 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.13 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.12 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.11 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.10 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.8 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.8.rc1 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.7 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.6 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.5 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py
libv8-3.16.14.4 vendor/gyp/test/ninja/action_dependencies/gyptest-action-dependencies.py