File: gyptest-intermediate-dir.py

package info (click to toggle)
gyp 0.1%2B20200513gitcaa6002-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,236 kB
  • sloc: python: 29,408; ansic: 1,087; cpp: 855; sh: 302; lisp: 258; objc: 234; asm: 33; makefile: 10
file content (44 lines) | stat: -rwxr-xr-x 1,400 bytes parent folder | download | duplicates (39)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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.

"""
Verifies that targets have independent INTERMEDIATE_DIRs.
"""

import TestGyp

test = TestGyp.TestGyp()

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

test.build('test.gyp', 'target1', chdir='src')
# Check stuff exists.
intermediate_file1 = test.read('src/outfile.txt')
test.must_contain(intermediate_file1, 'target1')

shared_intermediate_file1 = test.read('src/shared_outfile.txt')
test.must_contain(shared_intermediate_file1, 'shared_target1')

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

# Force the shared intermediate to be rebuilt.
test.sleep()
test.touch('src/shared_infile.txt')
test.build('test2.gyp', 'target2', chdir='src')
# Check INTERMEDIATE_DIR file didn't get overwritten but SHARED_INTERMEDIATE_DIR
# file did.
intermediate_file2 = test.read('src/outfile.txt')
test.must_contain(intermediate_file1, 'target1')
test.must_contain(intermediate_file2, 'target2')

shared_intermediate_file2 = test.read('src/shared_outfile.txt')
if shared_intermediate_file1 != shared_intermediate_file2:
  test.fail_test(shared_intermediate_file1 + ' != ' + shared_intermediate_file2)

test.must_contain(shared_intermediate_file1, 'shared_target2')
test.must_contain(shared_intermediate_file2, 'shared_target2')

test.pass_test()