summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/actions-depfile/gyptest-all.py
blob: 68b32d611c643358404a0c6b053e96f86e06700c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python

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

"""Verifies that depfile fields are output in ninja rules."""

import TestGyp
import os

test = TestGyp.TestGyp()

if test.format == 'ninja':
  test.run_gyp('depfile.gyp')
  contents = open(test.built_file_path('obj/depfile_target.ninja')).read()

  expected = [
    'depfile = depfile_action.d',
    'depfile = ' + os.path.join(
      'obj', 'depfile_target.gen/depfile_action_intermediate_dir.d'),
  ]
  test.must_contain_all_lines(contents, expected)

  test.build('depfile.gyp')
  test.built_file_must_exist('depfile_action.d')
  test.built_file_must_exist(
    'obj/depfile_target.gen/depfile_action_intermediate_dir.d')

  test.pass_test()